View Full Version : Got an error after install

07-24-2008, 07:12 AM
i installed this script and all i get it these 3 messages on screen and i cant find the problem.
..Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/inc/design.inc.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a2950482/public_html/index.php on line 39

..Warning: require_once(/usr/local/apache/htdocs/inc/design.inc.php) [function.require-once]: failed to open stream: Operation not permitted in /home/a2950482/public_html/index.php on line 39

..Fatal error: require_once() [function.require]: Failed opening required '/usr/local/apache/htdocs/inc/design.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a2950482/public_html/index.php on line 39 ..
here is line 39 of the index.php script ... any answer will be appreciated.

require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );

07-24-2008, 07:27 AM
The error indicates that the file you're accessing is outside of what PHP has been configured to allow. This 'BX_DIRECTORY_PATH_INC' constant is likely the problem, as it replaces with /usr/local/apache/httpd/inc when clearly the files you are running are located within /home/a2950482/public_html. I'm guessing that design.inc.php is actually located at /home/a2950482/public_html/inc/design.inc.php correct?

Can you find the location that BX_DIRECTORY_PATH_INC has been defined, and post what its value is (define('BX_DIRECTORY_PATH_INC', ???);)?

07-24-2008, 08:05 AM
I have no idea where it is ... ive searched for it before i asked ... what can i do about it?...can i just rename it to where it is located?

07-24-2008, 09:09 AM
Yes and no. The problem is that you're only real other option is to use relative paths, and unless you control you're current working directories, relative paths can be difficult when including several files in depth. I don't recommend changing it, and I'm guessing that a lot of you're scripts are written with a constant in front of the files.

Here's how you find it. We know that the constant is defined, so that means that there is either a definition for the constant in this file, or in another file that has been included before the design.inc.php file. If there is no define() call in the index.php file, look at its list of included/required files. Good starters are anything with the word constant in its name (include 'constants.php'), or if most of you're inclusions have a constant in front of them, one of them cannot - this is likely the file thats generating these constants. I need to know the code thats being used to create these constant's values ($_SERVER['DOCUMENT_ROOT'] for example), so that I can direct you on how to change them.