We have a custom script in shell with require_once 'abstract.php'; and our class extends Mage_Shell_Abstract.

On our dev environments this is working fine, but on staging we get the error

PHP Fatal error:  Class 'Mage' not found in /var/www/foo/public/shell/abstract.php on line 86

What can be the reason?

  • are you using modman? Oct 16, 2014 at 11:28
  • We use composer on the dev environment. But on the target machine no composer is used.
    – Alex
    Oct 16, 2014 at 12:41
  • 1
    @Alex, have you diagnosed the issue and found any solution?
    – mageUz
    Jan 16, 2015 at 18:01
  • 1
    We found out that a mixture of absolute and relative paths in the require_once statements caused problems and resolved it by adding DIR
    – Alex
    Jan 16, 2015 at 18:50

1 Answer 1


There seems to be a PHP bug caused by mixing relative and absolute paths. See stackexchange https://stackoverflow.com/q/26885077/288568

  • Hi alex is this issue now solved? Jan 23, 2015 at 17:17

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.