Search code examples
phpsecurityapachesafe-mode

Safe mode.. mkdir


I have a script that creates a directory "createddir" and sets the chmod to 777 (just for this test really..)

I then want to create subfolders, but then the script fails. because of safe mode.

Why was I able to create that first folder then? Is it because the folder now has different perms different from the gallery.php file which was uploaded via ftp?

Is there any way around this? This is a script for sale, I cannot ask people to simply disable safe mode as their host may not allow that.

Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. 
The script whose uid is 10005 is not allowed to access 
/var/www/vhosts/yyy/httpdocs/zzz/files/createddir owned by uid 33 in 
/var/www/vhosts/yyy/httpdocs/zzz/files/gallery.php on line 254

Solution

  • there is no way to solve it.
    Either turn safe mode off or create these folders from FTP client