Magento 关于 1.9.* 版本在 PHP7 上无法安装的问题

Magento2 对 PHP7 是支持的,但是 Magtento1 却不是,当我们在 PHP7 上安装 Magento 1.9.* 的时候,会报错无法继续安装。

要解决 PHP7 上无法安装 Magento 1.9.* 这个问题,找到以下文件进行修改:

文件:app/code/core/Mage/Core/Model/Layout.php

getOutput()函数里边,找到:

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

修改为:

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

或者修改为:

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

修改完毕,再试试是不是可以安装成功了!

如果有兴趣研究此情况的发生原因,可以查阅 PHP RFC: Uniform Variable Syntax

相关文章