osCommerce required files Error “Fatal error: require() [function.require]: Failed opening required ‘includes/functions/compatibility.php’” Solved

We encountered the following error on of our osCommerce sites,

Fatal error: require() [function.require]: Failed opening required ‘includes/functions/compatibility.php’

the problem was that the site’s web_root directory was not in php’s include path. To quickly fix the problem without having to mess with php.ini, or server settings we included the following line of code:

set_include_path(get_include_path() . PATH_SEPARATOR . $absolute_path_to_web_root);

as the first directive in /includes/application_top.php

where $absolute_path_to_web_root is the absolute server path to the webroot of the site, i.e. /home/website/www

Leave a Reply

Your email address will not be published. Required fields are marked *