drkstr Posted June 25, 2008 Share Posted June 25, 2008 Hello, I have a set of core files that I want to link to from various site directories and I was wondering if I could get a little help understanding the open_basedir restriction. I have /var/www/vhosts/base/php/phpinfo.php5 and a symlink to the absolute path at /var/www/vhosts/domain.com/httpdocs/php/phpinfo.php5 When I go to http://domain.com/php/phpinfo.php5 I get the following error: [Wed Jun 25 09:11:03 2008] [error] [client 71.227.145.81] PHP Warning: Unknown: open_basedir restriction in effect. File(/var/www/vhosts/domain.com/httpdocs/php/phpinfo.php5) is not within the allowed path(s): (/var/www/vhosts/domain.com/httpdocs:/tmp) in Unknown on line 0 [Wed Jun 25 09:11:03 2008] [error] [client 71.227.145.81] PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 [Wed Jun 25 09:11:03 2008] [error] [client 71.227.145.81] PHP Fatal error: Unknown: Failed opening required '/var/www/vhosts/domain.com/httpdocs/php/phpinfo.php5' (include_path='.:') in Unknown on line 0 I tried setting this line in the php.ini open_basedir = /var/www/vhosts But I still get the same error. Could anyone give me a little insight to understand the problem? Thanks in advance! ~Aaron Quote Link to comment https://forums.phpfreaks.com/topic/111882-open_basedir-restriction-and-symlinks/ Share on other sites More sharing options...
trq Posted June 25, 2008 Share Posted June 25, 2008 open_basedir = "/var/www/vhosts" Should work, did you restart apache after making the changes? Quote Link to comment https://forums.phpfreaks.com/topic/111882-open_basedir-restriction-and-symlinks/#findComment-574244 Share on other sites More sharing options...
drkstr Posted June 25, 2008 Author Share Posted June 25, 2008 Thanks for the quick reply! I updated the php.ini to use the quotes and restarted the server, but no help. When I copy the file to the site directory (which runs phpinfo() I noticed the open_basedir is set to: open_basedir /var/www/vhosts/domain.com/httpdocs:/tmp /var/www/vhosts I also noticed the error indicates the '/var/www/vhosts/domain.com/httpdocs:/tmp' setting. I'm not quite sure what the difference is between the local value and master value, but do you think the 'main' setting is being overridden by a local one? Thanks again! ~Aaron Quote Link to comment https://forums.phpfreaks.com/topic/111882-open_basedir-restriction-and-symlinks/#findComment-574276 Share on other sites More sharing options...
drkstr Posted June 25, 2008 Author Share Posted June 25, 2008 It was indeed a local configuration overriding the global settings. Resolved. Thanks for the help! ~Aaron Quote Link to comment https://forums.phpfreaks.com/topic/111882-open_basedir-restriction-and-symlinks/#findComment-574460 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.