Hey gang,
I'm trying to perform a fairly simple task: create a directory, and copy a file to it.
$dir = $wwwroot."/new_dir";
$source = "/dir/file.txt";
$dest = $dir."file.txt";
mkdir($dir);
chmod($dir, 0777);
copy($source,$dest);
The outcome of the script is that the directory is created, and assigned 777 permissions. Good so far, but then:
Warning: SAFE MODE Restriction in effect. The script whose uid is x is not allowed to access /new_dir owned by uid y
I did some checking at php.net, and apparently this is a reported bug. The permissions are set appropriately, but the owner isn't, rendering the folder useless to the script.
This is a fairly basic function I'm trying to perform, so I'm sure others do it all the time, and there must be a workaround...anyone know what it might be?
Thanks