Forum Moderators: coopster

Message Too Old, No Replies

MKDIR, CHMOD not doing its job under PHP environment?

         

irock

8:35 pm on Apr 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi I try to run a loop to create some directories...

$dir = "/home/virtual/site1/fst/var/www/html/solutions/data/$p";
mkdir('$dir', 0777);
chmod('$dir', 0777 );

While the mkdir works, the directory privileges aren't 777.

Anyone knows why?

I'm running this script on PHP 4.2.2.

andreasfriedrich

10:08 pm on Apr 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure mkdir [php.net] and chmod [php.net] are working? IŽd expect them to not create the directory you want them to since $dir is contained within single quotes and thus no variable interpolation takes place.


$dir = "/home/virtual/site1/fst/var/www/html/solutions/data/$p";
mkdir($dir, 0777);

should work.

Andreas