Throwing error while moving Magento 1 website on php 7 configured server.

Fatal error: Uncaught Error: Function name must be a string in /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Model/Layout.php:555 Stack trace: #0 /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput() #1 /home/mcs/html/sitemain/dev/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout() #2 /home/mcs/html/sitemain/dev/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route') #3 /home/mcs/html/sitemain/dev/app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route') #4 /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->noRouteAction() #5 /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('noRoute') #6 /home/mcs/html/sitem in /home/mcs/html/sitemain/dev/app/code/core/Mage/Core/Model/Layout.php on line 555


1 Answer 1


Magento 1.9 on PHP 7 is bit tricky to install because php 7 fully does not support Magento 1 and therefore when you install or move site on php 7 configured server it will show you blank screen, you will see above error when you enable the error reporting to 1 in index.php or in php.ini.

Enable error reporting:

ini_set('display_errors', 1);

That error comes because of syntax changes in php 7 which is deprecated, here is solution to this error.


You need to override app/code/core/Mage/Core/Model/Layout.php Line no 555

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

Replace or write override function for below line

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

This will fix your error for sure.


Not the answer you're looking for? Browse other questions tagged or ask your own question.