Question Locked

Script problems on new virtual dedicated server

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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 72.152.123.146] PHP Warning: main() [function.main]: open_basedir restriction in effect. File(/config.php) is not within the allowed path(s): (/var/www/vhosts/doctorswellnesscentre.com/httpdocs:/tmp:/var/lib/php) in /var/www/vhosts/doctorswellnesscentre.com/httpdocs/includes/common.php on line 63
[client 72.152.123.146] PHP Warning: main(config.php) [function.main]: failed to open stream: Operation not permitted in /var/www/vhosts/doctorswellnesscentre.com/httpdocs/includes/common.php on line 63
[client 72.152.123.146] PHP Warning: main() [function.include]: Failed opening 'config.php' for inclusion (include_path='.:') in /var/www/vhosts/doctorswellnesscentre.com/httpdocs/includes/common.php 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.

Thanks.

LU

2 replies

by mark.masloski

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/doctorswellnesscentre.com/conf/

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:

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

This discussion is closed to new replies.