PHP 5.3 & Magento Older Versions: How to use them together?

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.

Looking for improvement for your Magento Store?
Facebook Connector Extension
Product related article extension
Magento Offer popup on exit extension
Unlimited Slideshow Magento Extension
Light Checkout in One Step Magento Extension


Leave a Reply

Your email address will not be published.

sixteen + seventeen =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>