1

Does anyone know why this kind of messages appear? It seems like my Magento installation does not fully load all Zend classes, although they are there on a proper place with proper file permissions.

If I try removing the whole project and uploading it again, it happens again, only with different Zend class.

Does anyone know how to debug these kind of errors?


SOLVED: by clearing the APC cache on the server. For whatever the reason, it loaded the old instance of Magento in cache and only partially the new ones, therefore causing the buggy behaviour.

Thanks once again to Alan and mbalparda for their responses.

1
  • Also if file permissions are off after an upgrade, and some of the files are not readable, Magento will throw this exception. Aug 11, 2015 at 0:16

3 Answers 3

3

Magento's autoload should convert the class

Zend_Cache

into an include path of

Zend/Cache.php

and then look for that class in the following folders.

app/code/local/Zend/Cache.php
app/code/community/Zend/Cache.php
app/code/core/Zend/Cache.php
lib/Zend/Cache.php

In a standard install, it loads from lib/Zend/Cache.php. So, the first thing I'd do is make sure the lib/Zend/Cache.php is there, and there is not a file at the other locations. If there is a file at the other location(s), take a look inside and make sure a class named Zend_Cache is actually defined.

If the file's there, then it sounds like it's not being loaded correctly. The next debugging step I'd take is pinpointing the place in app/code/core/Mage/Core/Model/Cache.php where Magento's trying to use Zend_Cache, and make sure the PHP include paths have been setup correctly. Use some var_dump debugging like this.

    #File: app/code/core/Mage/Core/Model/Cache.php
    var_dump(explode(':',get_include_path()));
    exit;
    $this->_frontend = Zend_Cache::factory('Varien_Cache_Core', $backend['type'], $frontend, $backend['options'],
        true, true, true
    );

You should see output that looks something like this

array (size=6)
  0 => string '/path/to/magento/app/code/local' (length=61)
  1 => string '/path/to/magento/app/code/community' (length=65)
  2 => string '/path/to/magento/app/code/core' (length=60)
  3 => string '/path/to/magento/lib' (length=50)
  4 => string '.' (length=1)
  5 => string '/usr/local/php5/lib/php' (length=23)

If lib and the code pools (core, community, local) aren't in there, it meant you may be dealing with a modified app/Mage.php file, or you may be running in Magento compiled mode without having compiled classes (doubtful in your case since the error comes from app/code/core..., but you never know)

Finally, if the paths were setup correctly, I'd look at the autoloader and add some debugging.

#File: lib/Varien/Autoload.php
var_dump($class);
var_dump($classFile);

return include $classFile;

Look for the path the autoloader tries to create for Zend_Cache, and then figure out why it can't load the class.

Hope that helps!

3
  • Tnx mate for the response, I tried everything as you said and hit a dead end. Load paths are fine, files are there, file permissions are good. I tried completely removing the shop and cloning it again from GIT, and now the same happens only with different class: "Fatal error: Class 'Mage_GoogleCheckout_Model_Mysql4_Setup' not found" I'm thinking this could be something with the server configuration or memory limit or something.
    – Relja
    Jul 21, 2014 at 8:50
  • @Relja I'm confused, you did everything I said — but you didn't mention which file path the autoloader displayed Jul 21, 2014 at 13:56
  • It displayed exactly as you described, first 4 lines. I found out what was the problem, thanks once again for a detailed response.
    – Relja
    Jul 22, 2014 at 15:44
2

It seems your upload is failing and some files are missing. Find an official Magento package with the version you are using, install it as a new installation with a separated db and set of files and once that is done, merge (do not just overwrite) everything from your site into the fresh installation. This should fix the missing files.

4
  • Tnx, I already tried this - I have a GIT repo, I removed everything and cloned it again, and still it happens.
    – Relja
    Jul 21, 2014 at 8:46
  • Im not sure you fully understand the difference. Repo might be broken, try putting the repo on top of a fresh and running Magento instance. By doing that you will be able to see first if any other instance of Magento works where you are installing it and if it does not, you will be sure the code is not the issue but probably the environment.
    – mbalparda
    Jul 21, 2014 at 8:49
  • I think i saw this error somewhere else. Try the magento-check.php file (magentocommerce.com/_media/magento-check.zip) to see if the server meets the requirements. Also, as a lead, the codification/encoding of the files might be the issue. Im trying to justify the second lead but i cant find where i saw something like that
    – mbalparda
    Jul 21, 2014 at 8:53
  • Thanks man, I found what was the problem, it was cache on the server level.
    – Relja
    Jul 22, 2014 at 15:36
0

Solved by clearing the APC cache on the server. For whatever the reason, it loaded the old instance of Magento in cache and only partially the new ones, therefore causing the buggy behaviour.

Thanks once again to Alan and mbalparda for their responses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.