how fix open_basedir issue

blog

Verified User
Joined
Jan 28, 2011
Messages
131
Hi

I have loged error

[26-Nov-2013 08:28:46 UTC] PHP Warning: require(): open_basedir restriction in effect. File(/class/class.rewrite.php) is not within the allowed path(s): (/home/admin/domains/mydomain.com/public_html/:/tmp:/var/tmp:/usr/local/lib/php/:/home/admin/domains/mydomain.com/public_html/blog/) in /home/admin/domains/mydomain.com/public_html/blog/widget/index.php on line 10

on line 10 I have this code:

require ($_SERVER["DOCUMENT_ROOT"]."/class/class.rewrite.php");


How I should fix issue?
 
Are you sure $_SERVER["DOCUMENT_ROOT"] is not empty. I would print($_SERVER["DOCUMENT_ROOT"]); to make sure its not empty.
 
Did you do that print on the right place? Like on line 9 right above that require which is giving the error.

Yes, I think open_basedir path in httpd.conf isn't correct but I can't find solution
 
Change require to print and see if it prints out the full path.
 
Have you modified it? Or maybe in Custom HTTPD Config in DA? Or the template?

in Custom HTTPD Configurations I have used this codes

|?OPEN_BASEDIR_PATH=/home/admin/domains/mydomain.com/public_html/:/tmp:/var/tmp:/usr/local/lib/php/:/home/admin/domains/mydomain.com/public_html/blog/|
 
in Custom HTTPD Configurations I have used this codes

|?OPEN_BASEDIR_PATH=/home/admin/domains/mydomain.com/public_html/:/tmp:/var/tmp:/usr/local/lib/php/:/home/admin/domains/mydomain.com/public_html/blog/|

The second one with /blog/ is unnecessary since public_html is already in there the first time. Maybe that second one is overwriting the first one? Just a wild guess.

/home/admin/domains/mydomain.com/public_html/class/class.rewrite.php

That's kind of odd / related to the error, since the file which is causing the error is located /blog/, while it wants to include something of /class/ which is in the same level as /blog/ instead of inside /blog/
 
Back
Top