Ordner Erstellen

Spacejumper

Erfahrenes Mitglied
Hi leute ich nerve euch mal wieder mit einem Problem. Ich hänge mal eine Bildergallerie (ohne MYSQL) an die ich gemacht habe und die nicht so wie ich will es geht eigentlich alles jedoch das erstellen von ordnen mit der make.php klappt nicht.

Er soll einen Ordner stellen z. B. "Ich" in den ordner soll noch ein ordner "th" für die Thumbs und eine datei "data.dat" so:

Er erstellt jedoch nur den ersten ordner und auch nicht mit den attributen (chmod 777) wie er es soll.

Loeschen der Ordner und alles andere klappt ohne Probleme.

Offline (mit xampp) geht das script 100%ig

Danke für die Hilfe

P. S. Ich hänge alles an damit man mich auf weitere Fehler hinweisen kann! Danke
 

Anhänge

Zuletzt bearbeitet:
Offensichtlich hast du es nicht gelesen, sonst wüßtest du, warum dein erstellter Ordner die Rechte 755 hat:
You might notice that when you create a new directory using this code:

mkdir($dir, 0777);

The created folder actually has permissions of 0755, instead of the specified
0777. Why is this you ask? Because of umask(): http://www.php.net/umask

The default value of umask, at least on my setup, is 18. Which is 22 octal, or
0022. This means that when you use mkdir() to CHMOD the created folder to 0777,
PHP takes 0777 and substracts the current value of umask, in our case 0022, so
the result is 0755 - which is not what you wanted, probably.

The "fix" for this is simple, include this line:

$old_umask = umask(0);

Right before creating a folder with mkdir() to have the actual value you put be
used as the CHMOD. If you would like to return umask to its original value when
you're done, use this:

umask($old_umask);
 
Dann könnte es sehr hilfreich sein, wenn du uns erklärst, was genau, und warum etwas nicht geht. Wenn irgendwas nicht funktioniert, dann bekommst du immer eine PHP-Fehlermeldung. Wenn du uns diese verraten würdest, in Kombination mir der fehlerverursachenden Code-Zeile, dann könnten wir dir auch sagen, was du falsch gemacht hast.
 
Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 576 is not allowed to access /home/virtual/site72/fst/var/www/html/bild/aaa owned by uid 48 in /home/virtual/site72/fst/var/www/html/bild/make.php on line 24

Warning: touch(): SAFE MODE Restriction in effect. The script whose uid is 576 is not allowed to access /home/virtual/site72/fst/var/www/html/bild/aaa owned by uid 48 in /home/virtual/site72/fst/var/www/html/bild/make.php on line 25

Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 576 is not allowed to access /home/virtual/site72/fst/var/www/html/bild/aaa owned by uid 48 in /home/virtual/site72/fst/var/www/html/bild/make.php on line 28

Warning: fopen(aaa/data.dat): failed to open stream: No such file or directory in /home/virtual/site72/fst/var/www/html/bild/make.php on line 28

Warning: fwrite(): supplied argument is not a valid stream resource in /home/virtual/site72/fst/var/www/html/bild/make.php on line 29

Warning: fclose(): supplied argument is not a valid stream resource in /home/virtual/site72/fst/var/www/html/bild/make.php on line 30

Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site72/fst/var/www/html/bild/make.php:10) in /home/virtual/site72/fst/var/www/html/bild/make.php on line 31

Es soll 2 Ordner erstellen und 1 Datei

Ordner1 (chmod777)
---Datei (chmod777)
---Ordner2 (chmod777)

so Ordner1 wirderstellt mit chmod777 und ordner 2 und die Datei werden nicht erstellt
 
Zuletzt bearbeitet:
Wenn der Ordner und die Datei nicht erstellt werden, dann bekommst du auch eine Fehlermeldung, außer du hast einen logischen Fehler im Script, und du erstellst den Ordner und die Datei gar nicht.
Da ich keine Lust habe, zu raten, was an deinem Code falsch ist, wäre es hilfreich, wenn du uns den Code zeigst.
 
Zurück