Reply to mkdir() and safe_mode

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация