Jump to content

Archived

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

Kennywilson

OsCommerce Language Error Problem

Recommended Posts

After installing OsCommerce and adding a template to my site i am receiving the following errors

 

Warning: require(includes/languages/.php) [function.require]: failed to open stream: No such file or directory in /home/a1594174/public_html/shop/includes/application_top.php on line 299

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a1594174/public_html/shop/includes/application_top.php on line 299

 

 

The script in application_top.php around lines 229 are

 

// 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'];

  }

 

// 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');

 

// currency

  if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {

    if (!tep_session_is_registered('currency')) tep_session_register('currency');

 

    if (isset($HTTP_GET_VARS['currency'])) {

      if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

    } else {

      $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

    }

  }

 

// navigation history

  if (tep_session_is_registered('navigation')) {

    if (PHP_VERSION < 4) {

      $broken_navigation = $navigation;

      $navigation = new navigationHistory;

      $navigation->unserialize($broken_navigation);

    } else {

      $navigation = new navigationHistory;

    }

  } else {

    tep_session_register('navigation');

    $navigation = new navigationHistory;

  }

  $navigation->add_current_page();

 

// Shopping cart actions

  if (isset($HTTP_GET_VARS['action'])) {

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

    if ($session_started == false) {

      tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

    }

 

    if (DISPLAY_CART == 'true') {

      $goto =  FILENAME_SHOPPING_CART;

      $parameters = array('action', 'cPath', 'products_id', 'pid');

    } else {

      $goto = basename($PHP_SELF);

      if ($HTTP_GET_VARS['action'] == 'buy_now') {

        $parameters = array('action', 'pid', 'products_id');

      } else {

        $parameters = array('action', 'pid');

      }

    }

    switch ($HTTP_GET_VARS['action']) {

      // customer wants to update the product quantity in their shopping cart

      case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {

                                if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {

                                  $cart->remove($HTTP_POST_VARS['products_id'][$i]);

                                } else {

                                  if (PHP_VERSION < 4) {

                                    // if PHP3, make correction for lack of multidimensional array.

                                    reset($HTTP_POST_VARS);

                                    while (list($key, $value) = each($HTTP_POST_VARS)) {

                                      if (is_array($value)) {

                                        while (list($key2, $value2) = each($value)) {

                                          if (ereg ("(.*)\]\[(.*)", $key2, $var)) {

                                            $id2[$var[1]][$var[2]] = $value2;

                                          }

                                        }

                                      }

                                    }

                                    $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';

                                  } else {

                                    $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';

                                  }

                                  $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);

                                }

                              }

                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

                              break;

      // customer adds a product from the products page

 

Thanks for any help

Share this post


Link to post
Share on other sites

If the file isn't missing and the path to the file is correct the most likely culprit is file permissions and ownership. The language file required must be readable by the webserver process owner. Details can vary from one web host to another but typically the web server process will run under your username. Just be sure the files aren't owned by root for some reason. File permissions should probably be set to 744 or 644.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.