Home » Magento, PHP

Running Magento 1.3 and older versions in PHP 5.3

24 May 2011 Share/Bookmark

Magento works fine in PHP 5.3 from versions 1.4 and later. But, error is displayed in different pages when we use older versions (prior to 1.4) of Magento in PHP 5.3.

This is because some php functions are deprecated in PHP 5.3 and those functions have been used in Magento Older Versions.

I tested Magento version 1.3.2.4 in PHP 5.3 and encoutered the following errors. The solution is also posted along with each error:-

FRONTEND SECTION

File: /lib/Varien/Object.php
Line: 484

Change From:

public function __toString(array $arrAttributes = array(), $valueSeparator=',')

To:

public function __invoke(array $arrAttributes = array(), $valueSeparator=',')

File: /app/code/core/Mage/Core/Controller/Request/Http.php
Line: 274

Change From:

$host = split(':', $_SERVER['HTTP_HOST']);

To:

$host = explode(':', $_SERVER['HTTP_HOST']);

File: /var/www/m1324/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php
Line: 139

Change From:

$key.= $taxReq->__toString(array(), '_');

To:

$key.= $taxReq->__invoke(array(), '_');

ADMIN SECTION

File: /var/www/m1324/app/code/core/Mage/Admin/Model/User.php
Line: 374

Change From:

$nodePath = 'adminhtml/menu/' . join('/children/', split('/', $startupPage)) . '/action';

To:

$nodePath = 'adminhtml/menu/' . join('/children/', explode('/', $startupPage)) . '/action'; 

Hope this helps. Thanks.

From Mukesh Chapagain's Blog, post Running Magento 1.3 and older versions in PHP 5.3

email

php magento mukesh chapagain

Get New Post by Email
RSS Feed Subscribe RSS Feed