Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error when using english browser


ccg_webshop

Recommended Posts

When using an english language browser to surf to my new OsCommerce shop, you'll see the following error message:

 

Warning: main(includes/languages/.php): failed to open stream: No such file or directory in /var/www/k/kralenfan.nl/HTML/includes/application_top.php on line 285

 

Fatal error: main(): Failed opening required 'includes/languages/.php' (include_path='.:/usr/local/lib/php') in /var/www/k/kralenfan.nl/HTML/includes/application_top.php on line 285

 

The strange thing is that this error only occurs when using an English browser. When surfing to my shop in my native language browser (Dutch), everything works fine. In my admin I removed all languages after installing Dutch, but this useually doesn't produce any problems.

 

What could be the issue?

Link to comment
Share on other sites

When using an english language browser to surf to my new OsCommerce shop, you'll see the following error message:

 

Warning: main(includes/languages/.php): failed to open stream: No such file or directory in /var/www/k/kralenfan.nl/HTML/includes/application_top.php on line 285

 

Fatal error: main(): Failed opening required 'includes/languages/.php' (include_path='.:/usr/local/lib/php') in /var/www/k/kralenfan.nl/HTML/includes/application_top.php on line 285

 

The strange thing is that this error only occurs when using an English browser. When surfing to my shop in my native language browser (Dutch), everything works fine. In my admin I removed all languages after installing Dutch, but this useually doesn't produce any problems.

 

What could be the issue?

 

check your language settings because it now tries to open .php (which ofcourse does not exist) and it should try to open english.php

Treasurer MFC

Link to comment
Share on other sites

Yes, and it is now the only language I am able to select, since I deleted all others.

 

 

so to be clear :

 

you have as language settings :

 

name : nederlands

code : nl

image : whatever

directory : whatever

sort order : 1

set as default : true

 

yes ?

Treasurer MFC

Link to comment
Share on other sites

Yes, only it's called "dutch" everywhere and not "nederlands".

 

 

that is strange. normally when a person has a browser language you do not support, they get the default language.

 

you could test what happens in application top.

 

there is some code "like" this :

 

if ($given_language != '') {

$lng->set_language($given_language);

} else {

$lng->get_browser_language();

 

 

you could add before and after it this test code :

 

if ($browser_ip == 'your_ip_address') {

echo $lng->language['directory'];

}

 

then you see 1, what the default is and 2, what is coming from the browser settings. use your ip address so only you see the result.

Treasurer MFC

Link to comment
Share on other sites

that is strange. normally when a person has a browser language you do not support, they get the default language.

 

you could test what happens in application top.

 

there is some code "like" this :

 

    if ($given_language != '') {

      $lng->set_language($given_language);

    } else {

      $lng->get_browser_language();

you could add before and after it this test code :

 

if ($browser_ip == 'your_ip_address') {

echo $lng->language['directory'];

}

 

then you see 1, what the default is and 2, what is coming from the browser settings. use your ip address so only you see the result.

 

ofcourse if you only support dutch,

 

change $lng->get_browser_language();

to $lng->set_language('nl');

Treasurer MFC

Link to comment
Share on other sites

It sounds a bit complicated and I wonder how that would solve my problem. Woudn't it be easier to make a copy of the dutch folder, rename to english and re-install that language?

 

well, that depends on whether you want to solve the problem or the symptom.

 

If you copy dutch to english then from now on you will have to maintain 2 sets of language files. And what happens if someone has a spanish as their browser language ?

Treasurer MFC

Link to comment
Share on other sites

well, that depends on whether you want to solve the problem or the symptom.

 

If you copy dutch to english then from now on you will have to maintain 2 sets of language files. And what happens if someone has a spanish as their browser language ?

 

First of all, that is unlikely to happen as my site target a dutch / belgian audience only and secondly, I'm not a technician and I don't really get what I am testing when adding that code to the file. What information will it give me?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...