• 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

php include path

D

DamijanM

Guest
I have this strange error I cannot find a solution to. I would be really thankful for any insight.

I have created a subdomain in Plesk (8.6, CentOS 5.3 32bit, dedicated box). The php script fails on simple include.

The trick is that this same script runs fine on main domain. The script tries to include a php script from PEAR package. The path to pear is included in php.ini.

I have tried:
1) added open_basedir to vhost.conf in main domain and subdomain (http://kb.odin.com/en/432). I have tried both adding the pear directory and subdomain dir to open_basedir or setting open_basedir to none (running websrvmng and restarting apache, of course)
2) tried including the file with absolute path
3) tride running ini_set('include_path', ini_get('include_path')); before include (I read it helps sometimes)
4) checked that safe mode is off (both in plesk and vhost.conf, just in case)
5) checked permissions and experimented a little bit (but read-only for apache should be enough in any case)

I always receive the same error (3 lines):
[Thu Jun 03 22:22:06 2010] [error] [client X.X.X.X] PHP Warning: require(SOAP/Client.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.com/subdomains/alfa/httpdocs/test.php on line 3
[Thu Jun 03 22:22:06 2010] [error] [client X.X.X.X] PHP Warning: require(SOAP/Client.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.com/subdomains/alfa/httpdocs/test.php on line 3
[Thu Jun 03 22:22:06 2010] [error] [client X.X.X.X] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'SOAP/Client.php' (include_path='.:/home/pear') in /var/www/vhosts/mydomain.com/subdomains/alfa/httpdocs/test.php on line 3

I have a special version of PEAR in home dir but it really doesn't matter - it could have been official /usr/local/lib/php or whatever. The same script runs perfectly on the main domain.

I have tried setting subdomain in plesk as different user or as the same user - the result is the same: big fail. Are subdomains running differently in apache? Are there some restrictions I am not aware of?

Apache is 2.2.3, PHP is 5.2.13. No selinux running (fully disabled). Safe mode disabled for the domain.
 
I apologize to all for the mess. After a good night sleep, I immediately solved this problem.

I had named a file vhosts.conf instead of vhost.conf. Ridiculous of me. I should have went to bed earlier.
 
Back
Top