My bad, should've noticed that.
$myDir = 'test';
if(chmod(realpath($myDir), 0777)) { echo 'Successfully changed dir to 0777 permissions!'; }
echo '<br />Safe Mode is: ' . ini_get('safe_mode');
echo '<br />';
clearstatcache();
echo 'Permissions: ' . substr(sprintf('%o', fileperms($myDir)), -4);
echo '<br />';
if(chmod(realpath($myDir), 0755)) { echo 'Successfully changed dir to 0755 permissions!'; }
echo '<br />';
clearstatcache();
echo 'Permissions: ' . substr(sprintf('%o', fileperms($myDir)), -4);
After the changes the output is:
Safe Mode is:
Permissions: 0755
Permissions: 0755
I tried creating dir in this location: mkdir("./test2", 0700); but to no avail. Buffled.