adrianTNT Posted February 12, 2007 Share Posted February 12, 2007 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 https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/ Share on other sites More sharing options...
wildteen88 Posted February 12, 2007 Share Posted February 12, 2007 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 https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183054 Share on other sites More sharing options...
adrianTNT Posted February 12, 2007 Author Share Posted February 12, 2007 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 ? Link to comment https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183066 Share on other sites More sharing options...
adrianTNT Posted February 12, 2007 Author Share Posted February 12, 2007 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. Link to comment https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183093 Share on other sites More sharing options...
wildteen88 Posted February 13, 2007 Share Posted February 13, 2007 try require './settings.php'; instead of: require('settings.php'); Link to comment https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183762 Share on other sites More sharing options...
adrianTNT Posted February 13, 2007 Author Share Posted February 13, 2007 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 https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183775 Share on other sites More sharing options...
wildteen88 Posted February 13, 2007 Share Posted February 13, 2007 just a simple typo, seend godaddy an email about it. Link to comment https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183808 Share on other sites More sharing options...
adrianTNT Posted February 13, 2007 Author Share Posted February 13, 2007 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 https://forums.phpfreaks.com/topic/38222-solved-open_basedir-restrictions-can-i-disable-it-or-only-change-it/#findComment-183816 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.