2
votes

I'm getting a page with the following message:

Fatal error: Class 'Exception' not found in /home/mysite/public_html/lib/Varien/Exception.php on line 29

Here is the line that generates the error:

class Varien_Exception extends Exception {} 

Changing the line to call the global namespace (\Exception) doesn't help, I'm still getting the same message. Additionally, I don't get an autoloader warning about a missing file for the exception class, as I would get for using extends Exception22 {} for example.

The error started to show up after migration of a magento 1.3 CE installaion to a new server. I get it whenever I'm trying to open Magento Connect manager. The error page url looks like this: http://[MYSITE.COM]/index.php/admin/extensions_local/index/key/[SOMEID]/

I'm using PHP 5.4.39, and I can extend and use Exception in other PHP files.

1
Magento Connect Manager relies on PEAR. I'm not sure from your description if you just changed servers or of you attempted an upgrade from Magento CE 1.3. In either case, look into the PEAR installation and its dependencies on the new server. - Greg Robbins
@greg_robbins, I just changed to a new server, no upgrade attempted. will check the PEAR files. - ramiwi

1 Answers

0
votes

Don't think this is a PEAR issue, to me this looks like Autoloader-related issue, often related to filesystem permissions.

You can use xdebug and a dgbp-capable editor/debugger to step in the code and see what's actually going on.

First of all, I would inspect your Magento folder, to make sure that your PHP actually has access to all of the files in Magento "lib/", "var/cache/", and "app/" folders.

Then, excluded trivial filesystem permission issues, you can step in using xdebug (and emacs or NetBeans, if you like), eventually using the "xdebug_break()" as first instruction in that class file, before the class keyword.