首页 文章

致命错误:未捕获错误:函数名称必须是C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Model \ Layout.php中的字符串:555堆栈跟踪:#0

提问于
浏览
28

我从XAMPP(localhost / magento)访问Magento文件夹时遇到这些错误:

致命错误:未捕获错误:函数名必须是C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Model \ Layout.php中的字符串:555堆栈跟踪:#0 C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Controller \ Varien \ Action.php(390):Mage_Core_Model_Layout-> getOutput()#1 C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Install \ controllers \ WizardController.php(120):Mage_Core_Controller_Varien_Action-> renderLayout()#2 C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Controller \ Varien \ Action.php(418):Mage_Install_WizardController - > beginAction()#3 C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Controller \ Varien \ Router \ Standard.php(250):Mage_Core_Controller_Varien_Action-> dispatch('begin')#4 C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Controller \ Varien \ Front.php(172):Mage_Core_Controller_Varien_Router_Standard-> match(Object(Mage_Core_Controller_Request_Http))#5> C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Model \ App.php(354):Mage_Core_Controller_Varien_Front-> dispatch()#6 C:\ xampp \ htdo cs \ em0126 \ app \ Mage.php(683):Mage_Core_Mo位于第555行的C:\ xampp \ htdocs \ em0126 \ app \ code \ core \ Mage \ Core \ Model \ Layout.php

5 回答

  • 9

    你的解决方案

    致命错误:未捕获错误:函数名称必须是... app \ code \ core \ Mage \ Core \ Model \ Layout.php中的字符串:555 ...

    此错误很容易修复,因为问题出在以下行:

    $out .= $this->getBlock($callback[0])->$callback[1]();
    

    相反它应该是:

    $out .= $this->getBlock($callback[0])->{$callback[1]}();
    

    在下面给出链接http://www.code007.ro/making-work-magento-with-php-7-rc1/找到您的详细解决方案

  • 6

    它归功于PHP7

    不建议编辑核心文件 . 我们会覆盖它 .

    将此文件 app/code/core/Mage/Core/Model/Layout.php 复制到 app/code/local/Mage/Core/Model/Layout.php

    更改 app/code/local/Mage/Core/Model/Layout.php 文件中的代码(第555行)

    $out .= $this->getBlock($callback[0])->$callback[1]();
    

    至:

    $out .= $this->getBlock($callback[0])->{$callback[1]}();
    
  • 87

    将第555行更改为:

    $out .= $this->getBlock($callback[0])->{$callback[1]}();
    

    有用 . 但有一点我不确定这是不是真的是一个php7 . 我在我的网站上运行它,在同一台服务器上使用相同的文件和配置,并且在没有更改该行的情况下没有任何问题 .

  • 17

    转到app \ code \ core \ Mage \ Core \ Model \ Layout.php第555行和第555行

    change $callback[1] to {$callback[1]}
    
  • 13

    这是一个php7问题,因为当我从5.6升级到7.0时,我收到了这个错误 . 修复它我编辑的核心文件(希望很快就会有补丁),或者像之前的其他内容中提到的那样或者如下所示:

    转到app \ code \ core \ Mage \ Core \ Model \ Layout.php第555行

    $method = $callback[1];
    $out .= $this->getBlock($callback[0])->$method();
    

相关问题