Re: SAFE MODE Restriction - mkdir()

From: Date: Thu, 25 Nov 2004 00:05:14 +0000
Subject: Re: SAFE MODE Restriction - mkdir()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-202810@lists.php.net to get a copy of this message
SED wrote:
Hi, I have very wierd situation. The ISP is running in SAFE MODE. I use PHP to create a directory with mkdir("something", 0777), it works great! However, if I try to create a sub-directory (e.g. "something2") in the "something" directory, I get the following: Warning: SAFE MODE Restriction in effect. The script whose uid is 3703 is not allowed to access "something" owned by uid 508 in /www/login/filer.php on line 287 However, if I check the chmod of "something" directory it's 777. Why can't I use PHP-uid to do create or upload files to this "something" directory, which PHP-uid itself created?
Because SAFE MODE is on :-) It's all in the manual. something is created by the server process so it's also owned by server process. The script is owned by you and can access only directories and files owned by you. You can try to change the group (chgrp()) if safe_mode_gid is on, or use ftp functions to create the directories.

« previous php.general (#202810) next »