Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento array to string conversion bug

Tags:

php

magento

When i run my Magento 1.9 CE website on new php version(7.0.4) it start giving me error

Array to string conversion in /var/www/bigliving.local/public_html/app/code/core/Mage/Core/Model/Layout.php on line 555

Previously is on php 5.4 and working fine.

like image 316
Inder Matharoo Avatar asked Nov 29 '25 03:11

Inder Matharoo


2 Answers

Found solution for this issue, i follow the following steps and it works for me.

  1. Go in line number on 555 of this file /var/www/bigliving.local/public_html/app/code/core/Mage/Core/Model/Layout.php change the code to $out .= $this->getBlock($callback[0])->{$callback[1]}();
  2. Change the magento root folder and index.php permission to 755
like image 120
Inder Matharoo Avatar answered Dec 01 '25 18:12

Inder Matharoo


Try the PHP 7 compatibility extension for Magento 1

Edit: As pointed out in the comments below, the PHP 7 compatibility extension is deprecated, and PHP 7.2 support patches have been released: https://inchoo.net/magento/magento-1-official-php-7-2-patches/

like image 24
FrankSunnyman Avatar answered Dec 01 '25 17:12

FrankSunnyman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!