Duane
Duane

Reputation: 260

Can anyone help with this Magento error?

Fatal error: Call to a member function getArea() on a non-object in {directory}/includes/src/Mage_Core_Model_App_Area.php on line 155

Cropped up when I installed an extension that I wrote on a clean install of Magento. When ported to the dev server it took it down and I cant seem to find where it has originated. Disabling the extension changes nothing. Along with clearing the cache and all the regular Magento hiccups. I've ensured that file permissions are correct to the best of my knowledge.

Upvotes: 3

Views: 3924

Answers (2)

Alana Storm
Alana Storm

Reputation: 166066

The name of the file in your error

Fatal error: Call to a member function getArea() on a non-object in {directory}/includes/src/Mage_Core_Model_App_Area.php on line 155

indicates that Magento is operating with the compiler mode on. Installing new modules while operating in complied mode can make Weird Things™ happen. I'd say your behavior qualifies as a weird thing

Open a shell and change directories to the root of your application. Then type

$ cd shell
$ php compiler.php  state

Running from this shell sub folder is required, as the compiler.php assumes that's the base dire when including some important files. You should see output something like

Compiler Status:          Enabled
Compilation State:        Compiled
Collected Files Count:    5602
Compiled Scopes Count:    4

To disable to complier, type

$ php compiler.php disable

You can check to see if this script has done it's job by looking at

File: includes/config.php

If the two lines of code in this file are commented, Magento won't look for "compiled" code.

#define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');

If they aren't, then comment then out with the # mark (the enable/disable script uses and looks for a # and a # only).

Do that, and your error should go away (or at least change to something different, allowing further debugging)

Upvotes: 4

Anton S
Anton S

Reputation: 12750

path in /includes/src/ shows that you are using magento compiler. You have to remember that each time you install something:

  1. disable cache
  2. disable compiler
  3. refresh admin roles (if ACL is used) after installation

Upvotes: 3

Related Questions