Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: require(includes/languages//index.php)


roedel

Recommended Posts

Posted

Hello,

 

after installing a backup on my server i am having the issue that i am getting the following error messages:

 

trying to access the main page:

 

Warning: require(includes/languages//index.php) [function.require]: failed to open stream: No such file or directory in /home/xxxxxxx/public_html/europe/index.php on line 40

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages//index.php' (include_path='.:/usr/local/php52/pear') in /home/xxxxxx/public_html/europe/index.php on line 40

 

here line 40 from my Index.php:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

 

So obviously the "require code" two // should have the language file directory in between them,like: languages/english/index.php

 

Once i force code in line 40 to go directly into the English directory with:

"require(DIR_WS_LANGUAGES . '/english/' . FILENAME_DEFAULT);" another problem with the same root cause appears:

 

Warning: require(includes/languages//header_tags.php) [function.require]: failed to open stream: No such file or directory in /home/helixpar/public_html/europe/includes/header_tags.php on line 15

 

It seems that the application cannot load its language files causing the malfunction.

 

Does anybody have a clue how that could happen?

 

I browsed through many posts with similar error messages, i also set the configuration_value for Switch To Default Language in the configuration table to true, nothing seems to help.

 

Oh, and trying to access admin creates the same problem.

 

Your help is greatly appreciated.

 

Thanks

 

Chris

Posted

A better temporary fix is:

 

in application_top.php

 

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

 

change it to:

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

 

 

I suspect you have problem with you language setting in admin, check there.

 

 

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

Thanks Sam,

 

i found a problem in the language table, the field "code" was empty. I entered "en" for english and "de" for German, the site loads partly now. (I am wondering why the site worked before....)

 

But, i am getting another error message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_DISPLAY_NEW_PRODUCTS' at line 1

 

select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit MAX_DISPLAY_NEW_PRODUCTS

in the catalog

 

and in admin:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_DISPLAY_SEARCH_RESULTS' at line 1

 

select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_notes as notes, c.customers_email_address, c.customers_telephone, c.customers_dob, ci.customers_info_date_of_last_logon as last_logon, ci.customers_info_number_of_logons as num_logons, ci.customers_info_date_account_created as date_account_created, a.entry_city as city, a.entry_state as state_alt, z.zone_name as state, ctry.countries_iso_code_2 as country, a.entry_country_id from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join customers_info ci on c.customers_id = ci.customers_info_id left join countries ctry on a.entry_country_id = ctry.countries_id left join zones z on a.entry_zone_id = z.zone_id order by c.customers_lastname ASC, c.customers_firstname ASC limit 0, MAX_DISPLAY_SEARCH_RESULTS

 

I read some other posts with that 1064 error and fiddled with my "split_page_results.php" file, but no result...

 

here my "split_page_results.php" file:

 

<?php

/*

$Id: split_page_results.php,v 1.15 2003/06/09 22:35:34 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class splitPageResults {

var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name;

 

/* class constructor */

function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {

global $HTTP_GET_VARS, $HTTP_POST_VARS;

 

$this->sql_query = $query;

$this->page_name = $page_holder;

 

if (isset($HTTP_GET_VARS[$page_holder])) {

$page = $HTTP_GET_VARS[$page_holder];

} elseif (isset($HTTP_POST_VARS[$page_holder])) {

$page = $HTTP_POST_VARS[$page_holder];

} else {

$page = '';

}

 

if (empty($page) || !is_numeric($page)) $page = 1;

$this->current_page_number = $page;

 

$this->number_of_rows_per_page = $max_rows;

 

$pos_to = strlen($this->sql_query);

$pos_from = strpos($this->sql_query, ' from', 0);

 

$pos_group_by = strpos($this->sql_query, ' group by', $pos_from);

if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;

 

$pos_having = strpos($this->sql_query, ' having', $pos_from);

if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;

 

$pos_order_by = strpos($this->sql_query, ' order by', $pos_from);

if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;

 

if (strpos($this->sql_query, 'distinct') || strpos($this->sql_query, 'group by')) {

$count_string = 'distinct ' . tep_db_input($count_key);

} else {

$count_string = tep_db_input($count_key);

}

 

$count_query = tep_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, ($pos_to - $pos_from)));

$count = tep_db_fetch_array($count_query);

 

$this->number_of_rows = $count['total'];

 

$this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);

 

if ($this->current_page_number > $this->number_of_pages) {

$this->current_page_number = $this->number_of_pages;

}

 

$offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

 

//$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

$this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;

}

 

/* class functions */

 

// display split-page-number-links

function display_links($max_page_links, $parameters = '') {

global $PHP_SELF, $request_type;

 

$display_links_string = '';

 

$class = 'class="pageResults"';

 

if (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';

 

// previous button - not displayed on first page

if ($this->current_page_number > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a>  ';

 

// check if number_of_pages > $max_page_links

$cur_window_num = intval($this->current_page_number / $max_page_links);

if ($this->current_page_number % $max_page_links) $cur_window_num++;

 

$max_window_num = intval($this->number_of_pages / $max_page_links);

if ($this->number_of_pages % $max_page_links) $max_window_num++;

 

// previous window of pages

if ($cur_window_num > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';

 

// page nn button

for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {

if ($jump_to_page == $this->current_page_number) {

$display_links_string .= ' <b>' . $jump_to_page . '</b> ';

} else {

$display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' "><u>' . $jump_to_page . '</u></a> ';

}

}

 

// next window of pages

if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a> ';

 

// next button

if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a> ';

 

return $display_links_string;

}

 

// display number of total products found

function display_count($text_output) {

$to_num = ($this->number_of_rows_per_page * $this->current_page_number);

if ($to_num > $this->number_of_rows) $to_num = $this->number_of_rows;

 

$from_num = ($this->number_of_rows_per_page * ($this->current_page_number - 1));

 

if ($to_num == 0) {

$from_num = 0;

} else {

$from_num++;

}

 

return sprintf($text_output, $from_num, $to_num, $this->number_of_rows);

}

}

?>

 

Here another guy who had a identical problem, sadly he did not post the solution there, i hate that ;-)

http://www.ez-oscommerce.com/oscommerce-support/index.php-t299019.html

 

Anybody any idea????

 

Thanks

 

Chris

Posted

MAX_DISPLAY_NEW_PRODUCTS needs to be defined somewhere, but doesn't seem to be in the base osC (2.2 RC2a)! Anyway, as a Quick 'n' Dirty workaround, you can add

define ('MAX_DISPLAY_NEW_PRODUCTS', '5');

near the top of catalog/includes/modules/new_products.php. Use whatever value you want instead of 5.

 

Likewise, MAX_DISPLAY_SEARCH_RESULTS needs to be defined, but isn't in base osC! It is in the configuration table of the database (see install/oscommerce.sql), but doesn't appear to be defined for use in PHP code. Very strange. Maybe as a QnD workaround, put

define ('MAX_DISPLAY_SEARCH_RESULTS', '20');

in your application_top.php files, to be sure that everyone gets it set.

 

It's odd that no one else is reporting this as a problem. I'm looking at the RC2a code and both of these lack defines, so I don't think it's something messed up in your specific installation. Maybe someone else knows the answer?

Posted

MAX_DISPLAY_NEW_PRODUCTS does exist in the default osc, even in ms2, its a configuration value, it appears in admin under max values under the name New Products Module, that its missing implies problems with your dbase, check it with phpmyadmin.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

MAX_DISPLAY_NEW_PRODUCTS needs to be defined somewhere, but doesn't seem to be in the base osC (2.2 RC2a)! Anyway, as a Quick 'n' Dirty workaround, you can add

define ('MAX_DISPLAY_NEW_PRODUCTS', '5');

near the top of catalog/includes/modules/new_products.php. Use whatever value you want instead of 5.

 

Likewise, MAX_DISPLAY_SEARCH_RESULTS needs to be defined, but isn't in base osC! It is in the configuration table of the database (see install/oscommerce.sql), but doesn't appear to be defined for use in PHP code. Very strange. Maybe as a QnD workaround, put

define ('MAX_DISPLAY_SEARCH_RESULTS', '20');

in your application_top.php files, to be sure that everyone gets it set.

 

It's odd that no one else is reporting this as a problem. I'm looking at the RC2a code and both of these lack defines, so I don't think it's something messed up in your specific installation. Maybe someone else knows the answer?

 

 

If u install Total Configuration http://addons.oscommerce.com/info/5040 it will show u full details of all configuration values. wink.gif

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

Ok for me the problem is clear. My provider moved the database to a new server.

Many values in various SQL tables are missing or even empty, causing all errors mentioned.

 

Sadly they were working on that issue for hours, or better it looked like that.

After that they were telling me to check my PHP files so i trusted their diagnosis, what a mistake.

 

So if you encounter that problem and no PHP fixes seem to work, check your language and configuration table first. In my case letters in various words, code sequences were missing.

Archived

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

×
×
  • Create New...