• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Permission denied

Fran1

New Pleskian
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!
 
What is output of

# getenforce

command? Make sure that it has Disabled status.
 
@Fran1,

Try to use an absolute path, it seems to be the case that the basedir is not set properly (i.e. it is unknown to the script running).

If the absolute path does work, then you can work around the issue by declaring the basedir explicitly in the running script.

Kind regards.....
 
Back
Top