I recently restored a plesk backup due to some problems and now I'm getting some permission denied problems that dont allow my app to run properly.
This is how error log looks like
Warning: include_once(/MyAppPath/db/config/configDB.php) [function.include-once]: failed to open stream: Permission denied in /MyAppPath/db/con.php on line 5
Warning: include_once() [function.include]: Failed opening '/MyAppPath/db/config/configDB.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /MyAppPath/db/con.php on line 5
The line 5 of con.php file is a simple include
include_once dirname(__FILE__) . '/config/configDB.php';
I've checked that
echo realpath(dirname(__FILE__) . '/config/configDB.php');
prints /MyAppPath/db/config/configDB.php which is the expected
These are the permissions
/MyAppPath/db/con.php file:
-rw-r--r-- 1 myappuser psacln 4940 Jun 12 12:34 con.php
/MyAppPath/db/config/ directory:
drwxr-xr-x 2 myappuser psaserv 4096 Jun 12 11:05 config
/MyAppPath/db/config/configDB.php file:
-rw-r----- 1 myappuser psacln 336 Oct 15 2014 configDB.php
I don't understand why apache doesn't have permission to read configDB as stated in error log.
If I run 'chmod 644 configDB.php' then it works, however I think that 640 should be enough (and adequate) permissions.
could be this error caused by the plesk backup restore?? Maybe some issue with SeLinux?
please help me.
Thank you!
This is how error log looks like
Warning: include_once(/MyAppPath/db/config/configDB.php) [function.include-once]: failed to open stream: Permission denied in /MyAppPath/db/con.php on line 5
Warning: include_once() [function.include]: Failed opening '/MyAppPath/db/config/configDB.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /MyAppPath/db/con.php on line 5
The line 5 of con.php file is a simple include
include_once dirname(__FILE__) . '/config/configDB.php';
I've checked that
echo realpath(dirname(__FILE__) . '/config/configDB.php');
prints /MyAppPath/db/config/configDB.php which is the expected
These are the permissions
/MyAppPath/db/con.php file:
-rw-r--r-- 1 myappuser psacln 4940 Jun 12 12:34 con.php
/MyAppPath/db/config/ directory:
drwxr-xr-x 2 myappuser psaserv 4096 Jun 12 11:05 config
/MyAppPath/db/config/configDB.php file:
-rw-r----- 1 myappuser psacln 336 Oct 15 2014 configDB.php
I don't understand why apache doesn't have permission to read configDB as stated in error log.
If I run 'chmod 644 configDB.php' then it works, however I think that 640 should be enough (and adequate) permissions.
could be this error caused by the plesk backup restore?? Maybe some issue with SeLinux?
please help me.
Thank you!