Web Hosting Talk







View Full Version : open_basedir a little too greedy


Gyrbo
08-31-2003, 06:19 AM
I'm trying to use my own helpdeks script on my server and open_basedir seems to be doing its job a little too good.

You can see the error yourself: http://home.thinkhosted.com/helpdesk/admin/

Warning: open_basedir restriction in effect. File is in wrong directory in /var/www/virtual/thinkhosted.com/home/htdocs/helpdesk/admin/index.php on line 28

Fatal error: Failed opening required '../config.inc.php' (include_path='.:/usr/lib/php') in /var/www/virtual/thinkhosted.com/home/htdocs/helpdesk/admin/index.php on line 28


The lines:
//Load files
require('../config.inc.php');//this is the line
require('./common.inc.php');


But when you check, open_basedir shouldn't be a problem: http://home.thinkhosted.com/helpdesk/admin/phpinfo.php

This script used to work perfectly on my old server with a different control panel.

Does anyone know what could cause this?

Thank you for any help.

thedavid
08-31-2003, 12:03 PM
The open_basedir isn't configured very well - it allows for this:
include_path='.:/usr/lib/php'

Which means, the directory the script is running in, and /usr/lib/php/ Nothing else.

This can be fixed by changing the open_basedir value in the httpd.conf to something like this:

php_admin_value open_basedir "/home/USERNAME:/usr/lib/php:/usr/local/lib/php"

-David

Gyrbo
08-31-2003, 05:25 PM
The include_path doesn't really have anything to do with open_basedir, IIRC.
Such an include path is actually very comman, as you can still use .. to go up, the absolute paht also works.

I'm thinking this is a PHP problem, because when I move the helpdesk script from my subdomain to my main domain, it suddenly worked. I'm assuming PHP has a max depth it checks or something.