• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Problems with php includes outside of the site directories

P

paleck

Guest
I have been fighting for two days to get sites on the server to be able to access the php pear libraries in /usr/share/pear. As far as I can tell the permission are correct to allow apache access to the files. I have overridden the default include path, safemode include path and the open_basdir directive.

This is the message I get(The only change I have made from the logs is removing my IP and replacing the sitename with X):
[Tue Jun 24 17:58:04 2008] [error] [client ] PHP Warning: require_once(DB.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/vhosts/x/httpdocs/test.php on line 3
[Tue Jun 24 17:58:04 2008] [error] [client ] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'DB.php' (include_path='.:/usr/share/pear:/usr/local/lib/Smarty-2.6.19') in /var/www/vhosts/x/httpdocs/test.php on line 3

Text of test.php minus the php code tags, to keep from pissing off the forum software:
phpinfo();
require_once "DB.php";

Running the same code from the command line works fine as the apache user(I temporarily gave it a shell long enough to attempt to execute it as apache, then turned its shell off again). I have also tried providing the full path to the file in the require_once statement, but it still had the same error messages.

To me it almost seems like the apache is running in some type of jailed configuration to prevent access to the rest of the system, but I have never had a plesk server have this problem before.

Currently I am running on Plesk 8.2.0-rhel5.build82070706.15.

Any help would be much appreciated.
 
I have overridden the default include path, safemode include path and the open_basdir directive.

How? Did you configure httpd.include for the site?
 
How? Did you configure httpd.include for the site?

I know better than to edit the http.include file. I have used vhosts.conf to override the defaults and even tried editting it the php.ini with it. The php.ini file shows the directories in the include path as does the error message in my original post.
 
Oh no, I didn't mean to question you. Just inquisitive. I take it that you ran /usr/local/psa/admin/bin/websrvmng -a ?
 
Oh no, I didn't mean to question you. Just inquisitive. I take it that you ran /usr/local/psa/admin/bin/websrvmng -a ?

Yep, I didn't think you were, just letting you know that I didn't put it in the place I'm not supposed to.
 
Back
Top