Help - Search - Members - Calendar
Full Version: Warning: Include() Open_basedir
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
All4Italy
I am getting a "Warning: include() [function.include]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/[DIR]/templates/file.inc) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp)" error when I try to open a page with php. Is there anything I can do?

My includes are written as
include($_SERVER['DOCUMENT_ROOT'].'/[DIR]/functions/file.php');

Any assistance would be appreciated.







fenerli
Good practice is to specify the document root in a variable, at least something like:

$root = $_SERVER['DOCUMENT_ROOT'];

This is so in cases like this, you can easily manually change the document root to what it should be.
All4Italy
QUOTE(fenerli @ Dec 7 2008, 05:07 AM) *
Good practice is to specify the document root in a variable, at least something like:

$root = $_SERVER['DOCUMENT_ROOT'];

This is so in cases like this, you can easily manually change the document root to what it should be.



Great idea. Can you advise me on how to how to get PHP to see the includes as being within the proper path without doing a symlink?

Thanks. LD
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.