Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

URGENT help needed! application_top.php ERROR!!!


murph

Recommended Posts

I urgently need help here, angry customer and I'm sure someone here knows how to fix this :(

 

I've done lots of OSC stores and no problems at all. Then I get this customer that wants her default language in French. I download one of the French language packs and install, following all the directions. I go to admin and make french the default language.

 

BUT I am obviously missing a step as this is what I get now when trying to access the site:

 

Warning: main(includes/languages/french.php): failed to open stream: No such file or directory in /home2/arte/public_html/includes/application_top.php on line 285

 

Warning: main(includes/languages/french.php): failed to open stream: No such file or directory in /home2/arte/public_html/includes/application_top.php on line 285

 

Fatal error: main(): Failed opening required 'includes/languages/french.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/arte/public_html/includes/application_top.php on line 285

 

I've never had to go into application_top.php before. I had a look in there but don't know what to do. Obviously a line need to be input at line 285 (how the heck do I know which line that is???) in order for this french to work. Not only do I not know how to find line 285 but I have NO CLUE as to what needs to be typed in there <_<

 

Also is there anything I need to do in phpmyadmin for a new language to work?

 

Please help asap anyone! This client is ticked and stupid me had no idea enabling another language would be such a major. I posted once before about this but didn't get any replies so I am feeling a bit panicked here as I don't know how to fix this lady's store!!

Link to comment
Share on other sites

I've never had to go into application_top.php before. I had a look in there but don't know what to do. Obviously a line need to be input at line 285 (how the heck do I know which line that is???) in order for this french to work. Not only do I not know how to find line 285 but I have NO CLUE as to what needs to be typed in there

 

Some editing programs like HomeSite will number the lines for you so you can find the "bad" lines better.

 

In your case, application_top.php is squawking because it's looking for the includes/languages/french.php file and can't find it. The error's not with application_top.php itself, but line 285 is where it's looking for the missing file.

 

Chemo was right...just make sure that your french.php file is in the spot that application_top.php wants it to be in: includes/languages/french.php and you should have your problem solved.

Link to comment
Share on other sites

Hi guys, thanks for the responses. I did check the site and french.php is indeed in includes/languages right where it should be, along with the french folder there as well. It's all laid out just the same as the german.php etc - you have the language.php file right there under the includes/languages and then you have that languages folder there as well...click on the folder and all the language files are in there.

 

The instructions for the language pack were written in french lol and I don't speak french but I got a rough translation for babelfish and it said this, which seemed to indicate you need to do something in phpmyadmin???? Any more suggestions?

 

Language pack instruction translation:

 

To place the files has their respective places, to have all the translations of the file admin and catalog to have the configuration of l'admin fran?ais some; To make update SQL via phpMyAdmin for example [ executer the file ] This setting? day cr?e no news entr?e in the table 'configuration' and does not make qu'affecter the fields 'configuration_title' compared to the name of the variable of configuration: No the risk of destruction of donn?es. I n'ai not leave the translation of the titles of the configuration (table 'configuration_group') because it n' has that l'ID to update it, which could pose problems if the base?volue... and then 12 words has to translate, is necessary well that I leave some to you a little:)) that is also done by modifying the base of donnee xaglo

Link to comment
Share on other sites

The offending code is this:

    include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');

NOTE: the last require directive is the offending line. It appears like it is properly seeing French as the default language and is tryiing to include the file. However, it cannot open the file. FTP back in and make sure the webserver has read privilidges. I would recommend just SSH connect to the server, go to the directory, and type ls -l which will list the contents with their respective CHOWN:CHGRP and permissions. Basically, make the French file the same as the rest.

 

As for whether a language pack install needs MySQL work: I don't know since I've never installed a pack. However, I do know that it is properly trying to include the file but cannot.

Link to comment
Share on other sites

Holy Cow Chemo THANK YOU THANK YOU THANK YOU!!!! :D

 

It was something I never would have thought of (stupid me) until you pointed it out. It was PERMISSIONS!!! Yahoo, it works now after 2 weeks of beating my head against the wall trying to figure out the problem! Can't thank you enough :thumbsup:

Link to comment
Share on other sites

Glad to be of some service... :)

 

Hi,

 

I append my question to this forum instead of opening a new thread because my problem is really similar.

 

I am using milestone 2 too.

 

I have a different error in the same line 285 of application_top:

it is trying to include the file ".php"

the error is generated because $language is null, so

$language . ".php" gives ".php"

 

Looks simple?

the strange thing is that the error comes out only if I access my site from some hosts, while this isn't happening if I access from some other hosts. :blink:

 

I corrected the error with an instruction like:

if (!$language) { $language = 'italian'}

put just before line 285, but I am not happy with this solution.

 

After this patch I can finally see the site from any host.

But from the same hosts that were previously giving the error I am still having problems (example: in the homepage there are products listed, but if i click on them I got "product does not exist").

 

While from the other hosts everything works ok. :blink: :blink:

 

Digging into the code before line 285 in application_top

I have seen that it is the function session_start()

in the file include/classes/session.php

that's apparently giving a value to $language.

It looks like it has something to do with HTTP_GET_VARS

 

As I am not that fond of PHP I am really starting believing in ghosts... :'(

 

Has someone found the same behaviour?

 

Thank you all for any possible hint

Link to comment
Share on other sites

Make sure Italian is a valid langeage pack and that it is selected as the default language.

 

The source of your problem is most likely in this part of application_top:

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');

Looking through the includes/classes/language.php you'll see that the display language is pulled from getenv('HTTP_ACCEPT_LANGUAGE').

Link to comment
Share on other sites

first of all thank you Chemo

 

Make sure Italian is a valid langeage pack and that it is selected as the default language. 

 

I used a contribution called osc_2.2-MS2_ITA-lang-1.0b,

copied the various files including italian.php,

inserted italian in the db,

dropped the other language records (as italian should be the only one used)

and set italian as the default language in the admin panel

 

The source of your problem is most likely in this part of application_top:

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
...

 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');

Looking through the includes/classes/language.php you'll see that the display language is pulled from getenv('HTTP_ACCEPT_LANGUAGE').

 

I thought the same,

but in my installation the execution path never goes into:

 

  if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

 

that is $language is not set properly by the istance of the class.

 

As it works anyway on some hosts,

I tried to understand where $language was set by putting in some

echo "here $language is ".$language;

 

I found that $language apparently is not set in the snippet you quoted,

but is set before, at line 195:

 

194  } else {
echo "here $language is ".$language;
195    tep_session_start();
echo "here $language is ".$language;
196    $session_started = true;
197  }

 

tep_session_start() is in include/functions/session.php

calls

session_start() in include/classes/session.php

and here I am lost.

 

hmmm... thinking about this...

 

  if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

 

!tep_session_is_registered('language') :wacko:

does it mean 'language' is not in the list of session variables....

or is it already in the list so it should not be set... ? :unsure:

is it a configuration problem... ?

 

thank you again

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...