Jump to content

[SOLVED] open_basedir restrictions, can I disable it or only change it ?


adrianTNT

Recommended Posts

Hello.

 

When I run a script inside a directory in site I get the error:

 

open_basedir restriction in effect. File(/settings.php) is not within the allowed path(s): (/var/www/vhosts/site.com/httpdocs:/tmp

 

Can I disable this 'restriction' ?

I understand it doesn't allow me to include files form that directory, how can I fix this? I did some searching but I am confused  :-\

no you cannot override that restriction. However I believe you are including the file incorrectly.

 

Try adding a period before /settings.php so its ./setting.php

 

if you don't add that period you are telling php to include a file called settings.php in the root of file system. Wjen you add the period you tell php to include settings.php in the CWD (current working directory).

I see in error is says /settings.php but in script it is:

require('settings.php');

Script should be ok because it worked on previous server.

 

Maybe some other settings are wrong?

include_path maybe ? phpinfo says include_path is .:

Any ideas ?

Maybe it helps if I show you my phpinfo(), I was still unable to get rid of the error/warning:

 

http://www.adriantnt.com/index2.php

 

php info is on top and at bottom I am trying to include a file and get the errors I mentioned above.

Thanks WildTeen88, but the problem was something else, I managed to fix it by changing some system files on the server.

From what I understood it didnt allowed me to run scripts in that directory inside the site, it somehow had a predefined directory inside the site where I could run scripts, I edited system files and set that directory to site root then it worked.

 

The host has the solution here:

http://help.godaddy.com/article.php?article_id=1619&topic_id=&prog_id=GoDaddy&

create a vhost.conf file in your /var/www/vhosts/domain.com/conf/ directory, and enter the following lines:

 

<Directory /var/www/vhosts/domain.com/httpdocs>

php_admin_value open_basedir /path/you/require:/another/path/you/require

<Directory>

 

But I was surprised to see that the instructions ware incorrect, for example that XML syntax ^ doesn't close the XML tags properly in their example so if you try exact same thing will not work.

 

This one worked:

<Directory /var/www/vhosts/domain.com/httpdocs/>

php_admin_value open_basedir /path/you/require:/another/path/you/require

</Directory>

just a simple typo, send godaddy an email about it.

I don't know if they deserve it, when I have a problem and I ask them they are like:

"- Not our problem, you should have paid for assistance service" (assistance is something over $100, few months minimum).

But I will send them an email about the typo in their help files.

 

Anyway ... their support is as bad as people said it is, I had more problems with their support staff for different services of theirs. I think they got so big that they ran out of good techies.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.