QUOTE (mastercomputers @ Jul 21 2005, 12:35 PM)
<?php
$new_dir = 'new_directory';
if(!is_dir($new_dir))
mkdir("$_SERVER['DOCUMENT_ROOT']/$new_dir", 0755);
else
echo 'Directory already exists';
?>
I tried the above scripts and got
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/freehost/t35.com/u/r/url/config.php on line 22 .
After I tried "echo $_SERVER['DOCUMENT_ROOT'];", I got
/usr/local/apache2/htdocs .
Then I changed above scripts as following:
<?php
$credir = "/usr/local/apache2/htdocs";
$new_dir = 'new_directory';
echo "$credir/$new_dir";
echo $_SERVER['DOCUMENT_ROOT'];
if(!is_dir($new_dir))
mkdir("$credir/$new_dir", 0755);
else
echo 'Directory already exists';
?>
I got as following:
Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid/gid is 500/500 is not allowed to access /usr/local/apache2/htdocs owned by uid/gid 0/0 in /home/freehost/t35.com/u/r/url/config.php on line 22
I finally know why the directory can't be created, because it is in safe mode. But I still have a question. What is the exact absolute path is?
Is it "/usr/local/apache2/htdocs" or "/home/freehost/t35.com/u/r/url"? which one?
Comment/Reply (w/o sign-up)