I am running PHP 7.2 on an Ubuntu 18.04 server. I am trying to have a PHP script create a directory, but this is failing for some reason, and I am unable to figure out why. The permissions to the script are 777 and to the folders it is attempting to write to 705.
I have tried chowning the directory to the nobody group and this still does not work. Here is the code I am trying to make the directory:
if (!file_exists($sharexdir)) {
mkdir($sharexdir, 0705, true);
copy($_POST['type'].'/index.html', $sharexdir.'index.html');
}
I have added the following to test:
if(!mkdir('./img/12345/54321/', 0705, true)) {
echo 'Couldnt create folder';
}
if (!file_exists($sharexdir)) {
echo 'No exist';
}
I receive a Couldn't create folder and No Exist reply on POST