note 78063 added to function.chmod

From: Date: Wed, 26 Sep 2007 14:48:05 +0000
Subject: note 78063 added to function.chmod
Groups: php.notes 
Request: Send a blank email to php-notes+get-130798@lists.php.net to get a copy of this message
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 ---- Server IP: 194.145.210.4 Probable Submitter: 212.139.111.234 ---- Manual Page -- http://www.php.net/manual/en/function.chmod.php Edit -- https://master.php.net/note/edit/78063 Del: integrated -- https://master.php.net/note/delete/78063/integrated Del: useless -- https://master.php.net/note/delete/78063/useless Del: bad code -- https://master.php.net/note/delete/78063/bad+code Del: spam -- https://master.php.net/note/delete/78063/spam Del: non-english -- https://master.php.net/note/delete/78063/non-english Del: in docs -- https://master.php.net/note/delete/78063/in+docs Del: other reasons-- https://master.php.net/note/delete/78063 Reject -- https://master.php.net/note/reject/78063 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#130798) next »