Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/111882-open_basedir-restriction-and-symlinks/
Share on other sites

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.