任何人都可以帮助解决这个 Magento 错误吗?

发布于 2024-10-15 03:04:37 字数 245 浏览 2 评论 0原文

致命错误:调用成员函数 getArea() 在非对象上 {目录}/includes/src/Mage_Core_Model_App_Area.php 第 155 行

当我安装在 Magento 的全新安装中编写的扩展时出现。当移植到开发服务器时,它把它拿下来了,我似乎找不到它的起源。禁用扩展不会改变任何事情。以及清除缓存和所有常见的 Magento 问题。据我所知,我已确保文件权限正确。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鹿! 2024-10-22 03:04:37

错误中的文件名

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

表明 Magento 正在以编译器模式运行。安装新的
在编译模式下运行的模块可以使 Weird Things™ 发生。我想说你的行为是一件奇怪的事情

打开一个 shell 并将目录更改为应用程序的根目录。然后输入“

$ cd shell
$ php compiler.php  state

从这个 shell 子文件夹运行”是必需的,因为 compiler.php 假定这是包含一些重要文件时的基本目录。您应该看到类似于

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

“要禁用编译器,请键入”的

$ php compiler.php disable

输出。您可以通过查看“如果此文件中的两行代码被注释,Magento 将不会查找“已编译”代码来检查此脚本是否已完成其工作”

File: includes/config.php

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

如果不是,则使用 # 标记进行注释(启用/禁用脚本使用并查找 ##仅有的)。

这样做,你的错误就会消失(或者至少更改为不同的内容,以便进一步调试)

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)

尛丟丟 2024-10-22 03:04:37

/includes/src/ 中的路径显示您正在使用 magento 编译器。您必须记住,每次安装某些内容时:

  1. 安装后禁用缓存
  2. 禁用编译器
  3. 刷新管理员角色(如果使用 ACL)

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文