Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fix for Warning: main(includes/languages/.php): failed to open stream


Goyera

Recommended Posts

Just a solution for those seeking problems with this error. You might find this thread, you may not. I was having really difficult time trying to fix this error message for one of our old sites still running oscommerce. It took me about six hours to find the problem. We recently switched hosting and the problem occurred over and over again even when we migrated successfully. We must of re-imported the database and re-uploaded the FTP files about 9 times. After reading many threads with users saying "Fixed it" but didn't provide a solution or any clue it was frustrating.

We first attempted this fix:

knowledge.alzwea.com/2009/10/21/warning-requireincludeslanguages-php-function-require-failed-to-open-stream-no-such-file-or-directory-in-cwampwwwoscommercecatalogadminincludesapplication_top-php-on-line-157/

This resolved our problem, but none of the products or categories would display. Back again to the beginning. We then tried to clear the sessions table in the database. This worked too, but once the session was created we got the error again. We then checked the database to make sure the language table was all okay. It was fine. We knew it had something to do with the server. We tried PHP versions from 5.4 - 7.2 and this didn't fix the problem either. Strange as our old server was running 5.6 according to our web panel, or was it? ah! we should have used phpinfo.

We checked the old server and found this code within our .htaccess hidden away: SetEnv DEFAULT_PHP_VERSION 53. We switched to PHP 5.3 and the problem was instantly resolved and working like new on the new server. For some reason on the new server the above .htaccess entry wasn't working, hence giving us the errors with our new web hosting.

We then looked into upgrading the PHP version. We found a very useful article here posted on the forum :
www.crimsonshift.com/oscommerce-2-3-x-compatible-php-5-4-x-fix/

Anyways, hope it helps for those who discover this thread, as I suspect many will be using newer php versions down the line and bump into this error.

Common errors:

Warning: require(includes/languages/.php): failed to open stream: No such file or directory in /home/burnabyr/public_html/includes/application_top.php on line 279     Warning: require(includes/languages/.php): failed to open stream: No such file or directory in /home/burnabyr/public_html/includes/application_top.php on line 279     Fatal error: require(): Failed opening required 'includes/languages/.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/burnabyr/public_html/includes/application_top.php on line 279

Warning: main(includes/languages/.php): failed to open stream: No such file or directory in /home/munchie/public_html/includes/application_top.php on line 285  Warning: main(includes/languages/.php): failed to open stream: No such file or directory in /home/munchie/public_html/includes/application_top.php on line 285  Warning: main(includes/languages/.php): failed to open stream: No such file or directory in /home/munchie/public_html/includes/application_top.php on line 285  Fatal error: main(): Failed opening required 'includes/languages/.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/munchie/public_html/includes/application_top.php on line 285

Warning: session_start() [function.session-start]: open(SESSION_WRITE_DIRECTORY/sess_3asmrvkkps25moq07ld8mt2a21, O_RDWR) failed: No such file or directory (2) in /srv/www/htdocs/catalog/includes/functions/sessions.php on line 97     Warning: require(includes/languages/.php) [function.require]: failed to open stream: No such file or directory in /srv/www/htdocs/catalog/includes/application_top.php on line 285     Fatal error: require() [function.require]: Failed opening required 'includes/languages/.php' (include_path='.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/htdocs/catalog/includes/application_top.php on line 285     Warning: Unknown: open(SESSION_WRITE_DIRECTORY/sess_3asmrvkkps25moq07ld8mt2a21, O_RDWR) failed: No such file or directory (2) in Unknown on line 0     Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (SESSION_WRITE_DIRECTORY) in Unknown on line 0

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...