What does your file: includes/extra_configures/enable_error_logging.php look like?
The ZC 1.5.5 version of this file has this:
Code:
<?php
/**
* Very simple error logging to file
*
* Sometimes it is difficult to debug PHP background activities, especially when most information cannot be safely output to the screen.
* However, using the PHP error logging facility we can store all PHP errors to a file, and then review separately.
* Using this method, the debug details are stored at: /logs/myDEBUG-999999-00000000.log
* Credits to @lat9 for adding backtrace functionality
*
* @package debug
* @copyright Copyright 2003-2016 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Author: DrByte Sat Oct 17 20:09:58 2015 -0400 Modified in v1.5.5 $
*/
function zen_debug_error_handler ($errno, $errstr, $errfile, $errline) {
if (!(error_reporting() & $errno)) {
return;
}
ob_start();
if (version_compare(PHP_VERSION, '5.3.6') >= 0) {
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
} else {
debug_print_backtrace();
}
$backtrace = ob_get_contents();
ob_end_clean();
// The following line removes the call to this zen_debug_error_handler function (as it's not relevant)
$backtrace = preg_replace ('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $backtrace, 1);
error_log('Request URI: ' . $_SERVER['REQUEST_URI'] . ', IP address: ' . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'not set') . "\n" . $backtrace);
return false; // Let PHP's built-in error handler do its thing.
}
Which should provide the backtrace information that lat9 was asking about and provide much more than just the result of the program stopping.
It also seems to indicate that the language file(s) are loaded before the template has been identified which is what the error message is indicating: $template is undefined and therefore trying to access the method get_template_dir causes the error described. The question becomes why/how is that possible when $template is to be defined at load point 100 and the language to be identified after that at load point 110 with language files loaded then or later...
Bookmarks