What changes do I need to make Magento work with PHP 5.3?


Question

I need to upgrade my server to PHP 5.3 but have a Magento install and I know that Magento doesn't play nicely with PHP 5.3.

I think that the changes won't be too extensive (from what I've read). But, I figured I would open it up to the SO crowd.

Has anyone done this successfully? If so, did you take good notes?

1
4
8/18/2009 7:56:58 PM

Accepted Answer

Looks like they are still in the process of making it compatible:

http://www.magentocommerce.com/boards/viewthread/54158/

If I were you, I would wait for an official release before attempting an upgrade to PHP5.3

1
3/24/2013 11:23:03 AM

In order to run Magento 1.3.x on PHP 5.3, you need to replace the following function from the corresponding files:

1> index.php

error_reporting(E_ALL | E_STRICT);

to

 error_reporting(E_ALL & E_STRICT & ~E_DEPRECATED);


2> lib/Varien/Object.php

__toString 

to

 __invoke


3> lib/Varien/Pear.php

error_reporting(E_ALL & ~E_NOTICE);

to

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);


4> downloader/Maged/Pear.php

error_reporting(E_ALL & ~E_NOTICE);

to

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);


5> app\code\core\Mage\Catalog\Model\Layer\Filter\Price.php

__toString

to

__invoke


6> app\code\core\Mage\Core\Controller\Request\Http.php

split

to

explode


7> app\code\core\Mage\Catalog\Model\Category\Attribute\Backend\Sortby.php

split

to

explode


8> app\code\core\Mage\Admin\Model\User.php

split

to

explode

For terminal user who just want to apply patch, i would recommend to use the following article: http://goivvy.com/blog/magento1.3fix/

You can get more info from following Magento Blog:
http://www.blog.magepsycho.com/how-to-run-magento-1-3-x-on-php-5-3/

Hope this helps.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon