I saw several similar questions, but no answer worked in my situation, except that it probably has something to do with permissions.
The PHP script served by Apache tells me unable to open database file
.
When I print the path to this file, it returns a valid path, say DBPATH. The file exists in this place; I gave him and his parent folder 777
rights; I gave them user:user
access, where user
is the sudoer to which all script files belong. I did the same in the entire folder htdocs/
, just in case.
When I print file_exists(DBPATH)
, it returns false. Most likely, this is a permission issue, but I do not know what I have to change for PHP in order to have access rights. I also tried apache:apache
. I can not su apache
(user unavailable).
My scripts are in htdocs/
. DBFILE is somewhere (I tried /tmp/test
everything in 777
, but no luck).
No safe_mode, PHP 5.4 just installed, CentOS7.
Please give me a key, at least to help debug it. Maybe, for example: how can I check if my file will be readable from apache / my php script without running the script itself? How can I get the username that is used to execute it?