Fatal error: Call to a member function getModelInstance() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/magento/app/Mage.php on line 463

user3728443 picture user3728443 · Aug 7, 2014 · Viewed 15.1k times · Source

I install magento 1.9.0.0 and copy to my xampp htdocts when I run localhost/magento this error shows,i've done the solutions but it didn't work.

Fatal error: Call to a member function getModelInstance() on a non-object in    
 /Applications/XAMPP/xamppfiles/htdocs/magento/app/Mage.php on line 463

Here is the code script:

public static function getModel($modelClass = '', $arguments = array())
  {
    return self::getConfig()->getModelInstance($modelClass, $arguments);
  }

Answer

BenRoe picture BenRoe · Aug 8, 2014

The problem is related with some write permissions. Set write permissions to the following folders app/etc, var and media.

cd /xampp-folde/htdocs/magento
chmod -R 777 app/etc
chmod -R 777 var
chmod -R 777 media