Script problems on new virtual dedicated server

By admin ·
Hi everyone:

We recently purchased hosting from Godaddy for a linux virtual dedicated server and are in the processing of transferring four domains from our shared web hosting site to the new VDC. One of the problems I have run into is in our existing PHP scripts. These scripts use the PHP "include" command to load scripts for one or more exterior files. However, when I try to open the page that contains those scripts, I receive the following errors in the domain error log:

[client] PHP Warning: main() [<a href='function.main'>function.main</a&gt: open_basedir restriction in effect. File(/config.php) is not within the allowed path(s): (/var/www/vhosts/ in /var/www/vhosts/ on line 63
[client] PHP Warning: main(config.php) [<a href='function.main'>function.main</a&gt: failed to open stream: Operation not permitted in /var/www/vhosts/ on line 63
[client] PHP Warning: main() [<a href='function.include'>function.include</a&gt: Failed opening 'config.php' for inclusion (include_path='.:') in /var/www/vhosts/ on line 63

I have tried to change the httpd.conf file to include the path in the open_basedir settings, but I have been unsuccessful. I do not completely understand how open_basedir affects the server or how the include_path setting in the php.ini file affects browsing, etc.

If someone could point me in the right direction, I would greatly appreciate it. Our new VDC has been installed for about a week and we are unable to use it becaues I can't figure out the above problem.



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

open_basedir work around for Godaddy Virtual Dedicated Linux servers

by mark.masloski In reply to Script problems on new vi ...

I'm sure you have already figured this out... but it may be helpfull to others.

There is a way to shut of the open_basedir directive so that you do not have to add a bunch of directories.

You will have to create a file named "vhosts.conf" in /var/www/vhosts/

You will add lines that use the value "none" to shut it off......
To do this, type the following to create this file:

"cat > vhosts.conf"

Then add these lines immediately below:

"<Directory /var/www/vhosts/>
php_admin_value open_basedir none

Then hit "ctrl+D" to stop editing lines.

Now you will want to save this and gracefully restart your server with the following command:
"/usr/local/psa/admin/bin/websrvmng -a -v"

This command will update your main httpd.include file and you should not get those errors any longer.

Related Discussions

Related Forums