Christian Abbott February 2016

Magento 500 server error because of Zend

I cannot access front or back end of my Magento site. I was in Magento Connect and tried upgrading the Zend framework, but as it was attempting to do so, the browser crashed. I tried to go back in but I'm getting a 500 server error on both ends.

The error messages are:

Warning: include(Zend/Log.php): failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94

Warning: include(Zend/Log.php): failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94

Warning: include(): Failed opening 'Zend/Log.php' for inclusion (include_path='/app/code/local:/app/code/community:/app/code/core:/lib:.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') in /lib/Varien/Autoload.php on line 94

Fatal error: Class 'Zend_Log' not found in /app/code/core/Mage/Core/functions.php on line 247

How can I get it working again?

After trying possible fix, I now get this error message:

**Warning: include(Zend/Cache.php): failed to open stream: No such file or directory  in /lib/Varien/Autoload.php on line 94
#0 /lib/Varien/Autoload.php(94): mageCoreErrorHandler(2, 'include(Zend/Ca...', '/...', 94, Array)
#1 /lib/Varien/Autoload.php(94): Varien_Autoload::autoload()
#2 [internal function]: Varien_Autoload->autoload('Zend_Cache')
#3 /app/code/core/Mage/Core/Model/Cache.php(135): spl_autoload_call('Zend_Cache')
#4 /app/code/core/Mage/Core/Model/Config.php(1354): Mage_Core_Model_Cache->__construct(Array)
#5 /app/Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/cache', Array)
#6 /app/code/core/Mage/Core/Model/App.php(412): Mage::getModel('core/cache', Array)
#7 /app/code/core/Mage/Core/Model/App.php(306): Mage_Core_Model_App->_initCache(Array)
#8 /app/code/core/Mage/Core/Model/App.php(348): Mage_Core_Model_App->baseInit(Array)
#9 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /index.php(83): Mage::run('', 'store')
#11 {main}**

      

Answers


Alan Storm February 2016

You're error isn't necessarily due to the Zend Framework. If you look at the lines PHP is complaining about

#File: app/code/core/Mage/Core/functions.php
function mageCoreErrorHandler($errno, $errstr, $errfile, $errline){
    //...
    if (Mage::getIsDeveloperMode()) {
        throw new Exception($errorMessage);
    } else {
        Mage::log($errorMessage, Zend_Log::ERR);
    }
}

You'll see the error is happening in Magento's custom PHP error handler. i.e. -- PHP is trying to report an error of some sort, and Magento's custom error handling code reaches this line

Mage::log($errorMessage, Zend_Log::ERR);

and the halts, because the Zend_Log::ERR constant hasn't' been defined yet. This is a long standing bug in the Magento 1 framework for errors that happen early in the bootstrap process.

Two possible fixes here:

  1. Switch Magento into developer mode and instead of logging the error, Magento will throw an exception. This will let you see the real error message and diagnose the problem.

  2. Temporarily add the following line before the Mage::log call

.

require_once 'lib/Zend/Log.php';
Mage::log($errorMessage, Zend_Log::ERR);

This will include the missing file and let PHP finish its error logging (which should, again, let you see the real error message in the logs and start diagnosing the problem)

Post Status

Asked in February 2016
Viewed 3,851 times
Voted 11
Answered 1 times

Search




Leave an answer