Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A solution to everyone's basedir problems?


Guest

Recommended Posts

I've had trouble with OSC finding my include files and keep getting:

 

Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/mywebsite.com/httpdocs/catalog/includes/application_top.php on line 29

 

Fatal error: Failed opening required 'includes/configure.php' (include_path='/usr/share/pear/PEAR.php') in /home/httpd/vhosts/mywebsite.com/httpdocs/catalog/includes/application_top.php on line 29

 

Is this because of some PHP.ini setting to help security?

 

Adding this to the top of EVERY script that uses an include statement seems to work:

 

ini_set("include_path","/home/httpd/vhosts/mywebsite.com/httpdocs/catalog/");

 

(where the path is unique to your own site, you'll have to find that out!)

 

This points PHP in the right base directory to look for include files, but is a headache to implement due to the amount of files that need changing! As I don't have access to the php.ini file on the server, this is the only way I know to do it!

 

Everytime you change one file, the errors point you to another file that needs changing. I stopped after a while, but I have the feeling that using this statement may stop other functions working - before changing this value with ini_set, the include_path points to the PEAR directory which might well be used for database connections...

 

I'm fairly new to all of this, can anyone clarify things?

Link to comment
Share on other sites

If you can use .htaccess files (otherwise have your host do it in a <DIRECTORY> block in httpd.conf), try adding the following to the .htaccess in the catalog directory

php_value include_path /home/httpd/vhosts/mywebsite.com/httpdocs/catalog/

Hth,

Matt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...