Hi, I'm creating a small file manager. I started with the directory creation script. I couldn't make it work with the FTP commands (which are less secure anyway if I understanbd correctly...)
I have one page/script which creates directories and another to browse them. At the core of the directory creation is the following:
$old_umask = umask(0);
mkdir($newdir, 0777);
chmod($newdir, 0755);
(this is preceeded by a line which updates my databse with the new directory info)
In the file browser page/script, the code brings up the list of directories. If I manually create a dir via my ftp client, the directory browser opens it without a hitch. But when I attempt to access the directories created with the script above, I get this error:
Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 789 is not allowed to access [..path..] owned by uid 48 in [..path..browse.php] on line 22
the error refers to this line of code:
$open = opendir($currentpath);
where $currentpath refers to the newdir in this instance.
Is there a way I could access the script created directories? Is it simply a matter of chmod?
There is this other thread regarding this same problem but I'm also facing the SAFE MODE restiction issue.
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10263494&highlight=opendir