mkdir() failing
Posted: Tue Dec 18, 2007 7:10 am
A seemingly simple problem has now begun to waste several hours of my time and I've run out of solutions and workarounds, I wonder if you guys can help.
The basic problem is a failed call to mkdir() with a "permission denied" error message.
The call looks like this:
PHP version is 5.1.2 running as Apache 2 Handler on Linux
open_basedir is off.
safe_mode is off.
PHP runs as the user osnet and the containing directory of the ones to be created is owned by that user web osnet and has the read, write and execute flags set.
mkdir() isn't the only thing affected. If I manually create the directories the next thing involving the filesystem (file_put_contents) fails too. However, I am able to create the directories using PHP, even when running as the web user (osnet):
Any ideas?
The basic problem is a failed call to mkdir() with a "permission denied" error message.
The call looks like this:
Code: Select all
mkdir('/var/www/vhosts/olliesaunders.net/code/../data/comments/articles', 0755, true);open_basedir is off.
safe_mode is off.
PHP runs as the user osnet and the containing directory of the ones to be created is owned by that user web osnet and has the read, write and execute flags set.
mkdir() isn't the only thing affected. If I manually create the directories the next thing involving the filesystem (file_put_contents) fails too. However, I am able to create the directories using PHP, even when running as the web user (osnet):
Code: Select all
sudo -u osnet php -r 'mkdir("/var/www/vhosts/olliesaunders.net/code/../data/comments/articles", 0755, true);'