note 78063 rejected from function.chmod by nlopess
| From: | nlopess@php.net | Date: | Wed, 26 Sep 2007 20:47:57 +0000 |
| Subject: | note 78063 rejected from function.chmod by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130804@lists.php.net to get a copy of this message | ||
Note Submitter: clive at cliveread dot me dot uk
----
Hello, I am having a slight problem. What I'm trying to do is to have my site automaticly
create a Directary, CHMOD it to 0777 and then create 2 other folder's inside the original one
created and also CHMOD them to 0777 like the first. This is the php code im using that seems to
work.
mkdir($_SERVER['DOCUMENT_ROOT']."/test/1", 0755);
chmod($_SERVER['DOCUMENT_ROOT']."/test/1".$name, intval(0777, 8));
That code works and creates the first folder I want to make, but if i do it a secand time to create
the folder inside that one using the same code e.g.
mkdir($_SERVER['DOCUMENT_ROOT']."/test/1", 0755);
chmod($_SERVER['DOCUMENT_ROOT']."/test/1".$name, intval(0777, 8));
mkdir($_SERVER['DOCUMENT_ROOT']."/test/1/2", 0755);
chmod($_SERVER['DOCUMENT_ROOT']."/test/1/2".$name, intval(0777, 8));
I get this...
Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 32313 is
not allowed to access /home/xxxx/public_html/test/1 owned by uid 99 in
/home/xxxx/public_html/test.php on line 11
Warning: chmod() [function.chmod]: Unable to access /home/xxxx/public_html/test/1/2 in
/home/xxxx/public_html/test.php on line 12
Warning: chmod() [function.chmod]: No such file or directory in /home/xxxx/public_html/test.php on
line 12
Now I can't seem to work out why its not making the 2nd folder with CHMOD 0777 because I
beleave that if it works once it should work again
Any suggestions?
Thanks
Clive