Anyone figure out the open_basedir restriction problem

Support/Development for PHP
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

I think now the only problem left is with your include code. What is the line you use in your PHP script?
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

It isnt my script, but i know it works with apache on windows and it worked on a previous host i had that used cpanel.

Code: Select all

require_once('inc/config.php');
You can see the entire index file here.
http://jspwebhost.com/domains/index.txt
And the config.php file is here.
http://jspwebhost.com/domains/inc/config.txt
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Looking at the error it seems like config.php is trying to include /mysql.class.php. I don't know where it gets the leading / though. I think this may be a question for a PHP programmers forum...
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

There is no leading / in the source for the config.php file but it does have its own include statement for mysql.class.php.

Code: Select all

require_once('mysql.class.php');
require_once('funcs.php');
require_once('tpl.class.php');
This isn't the only php program im having a problem with, i also can't run Cerberus helpdesk. It gives the same errors, i just figured this program would be easier to look at.

Is there a way to disable this restriction on the whole server perhaps? So that including files would not be such an issue.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Setting open_basedir server-wide won't help, because every httpd.include sets a vhost specific open_basedir which would override the server-wide value you'd put in /etc/php.ini. You'll have to use php_admin_value open_basedir none in vhost.conf for every domain you wan't to disable the open_basedir restriction on. Setting this might enable your clients to read each other's files, so make sure you know what you are doing.
Lemonbit Internet Dedicated Server Management
jim0615
Forum User
Forum User
Posts: 15
Joined: Sat Sep 09, 2006 10:16 pm

Unread post by jim0615 »

Thank you soo much, now they work:-).
Post Reply