Junsee
07-28-2012, 09:59 PM
I am having trouble implementing code for setting "Access All" on the folder permissions for my web folder.
I've tried a number of lines of code but I can't seem to get it right. I am running a script install.php from a test folder
like so:
www.test.com/test/install.php
I want to make /test/ 0777 permission, and it currently is set at 0755
I've tried
$FullPath = $_SERVER['DOCUMENT_ROOT']. '/Test';
echo $FullPath;
mkdir($FullPath,0777,true);
chmod($FullPath, 0777) or die ("Permission not granted for root");
also
$FullPath = '../Test';
and just plain setting the chmod as 0777 (no mkdir)... its got me stumpped and banging my head!
I have set perrimisions on this webserver before, so I can't understand why it refuses to work. In those cases I created folders first and then set the chmod, as I have a server that doesn't allow direct setting of mkdir permission, for whatever reason (which reminds me the webserver is linix based). The only thing I can think of is that some how you can't set permission of folder you are in?
Going crazy ... and thanks in advance
James
I've tried a number of lines of code but I can't seem to get it right. I am running a script install.php from a test folder
like so:
www.test.com/test/install.php
I want to make /test/ 0777 permission, and it currently is set at 0755
I've tried
$FullPath = $_SERVER['DOCUMENT_ROOT']. '/Test';
echo $FullPath;
mkdir($FullPath,0777,true);
chmod($FullPath, 0777) or die ("Permission not granted for root");
also
$FullPath = '../Test';
and just plain setting the chmod as 0777 (no mkdir)... its got me stumpped and banging my head!
I have set perrimisions on this webserver before, so I can't understand why it refuses to work. In those cases I created folders first and then set the chmod, as I have a server that doesn't allow direct setting of mkdir permission, for whatever reason (which reminds me the webserver is linix based). The only thing I can think of is that some how you can't set permission of folder you are in?
Going crazy ... and thanks in advance
James