|
Posted by Markus on 06/28/07 11:56
Hello
I ran into the commonly known problem that under safe_mode it is
possible to create a directory with mkdir(), but impossible to create a
subdirectory inside the first one:
1 $path = $_SERVER['DOCUMENT_ROOT'].'/cache';
2 mkdir($path, 0755);
3 chmod($path, 0777);
4 mkdir($path.'/subdir', 0755);
Line 2: works (fails with 0777, though...)
Line 3: works
Line 4: Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in
effect. The script whose uid is 10677 is not allowed to access
[...]/cache owned by uid 48 in [...]
Now while googling I found out that the directories must be created via
FTP, as they belong to the FTP user. I am able to do this, but when the
ftp server is busy this can significantly slow down the system.
Are there some better recommendations how to handle this? If not, as
most web sites in shared hosting environments (where safe_mode is an
issue at all) are uploaded to the server via FTP, the mkdir() function
looks quite useless to me...
Thanks for a comment!
Markus
Navigation:
[Reply to this message]
|