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  :-\

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.