Hi guys, sorry for crossposting. Posted my issue in the php section because it was related to sth I found there. However, actually it's an apache topic. (Might be the reason that I didn't get an answer for days...) In short, my problem is that apache (on Fedora 9) says it was not permitted to write to other directories than /var/www/html/ and /tmp/. fopen("/opt/www-data/test.log", "a"); gives Permission Denied. I checked the permissions on the filesystem, apache is the owner (if not, still everybody has write permission). The path is correct. getmyui() and getmygid() give 48 and 48. stat('/opt/www-data/test.log')['uid'|'gid'] same values. I tried using /tmp instead, works. I cannot see why I can't write to /opt. Also tried using system("touch /opt/www-data/test") which gives the same issue. On the console with sudo -u apache touch /opt/www-data/test it works. Any idea? (As always: works on another system but can't see the difference.) Thanks, Tim
It's probably the open_basedir value, check which paths are available in either your apache config or php config.
Does this issue relate just to /opt directory? Are you able to create files in any other directories?
Hey, thanks for the reply. Have not been at work the last days, so I didn't answer before, sorry. I checked the open_basedir option; it is not set. It's not only related to /opt but to all directories other than /tmp and /var/www/html Tim
Any more ideas? Maybe related to vhosts or document roots? I still have no idea. I can "sudo -u apache touch /opt/www-data/log" but apache itself refuses to do so.
does this output the user you expect ? echo `whoami`; Code (markup): It's possible that PHP isn't executing using Apaches' credentials if something like suPHP is being used.
Yes, it does. Gives "apache". Checked that as well with getmyuid() and stat(), which give matching results.