Home > Uncategorized > Making Magento 1.3 run on PHP 5.3

Making Magento 1.3 run on PHP 5.3

September 3rd, 2009

With the release of PHP 5.3, many functions automatically trigger a function is deprecated error. With Magento, that error effectively stops execution, even if it’s actually just a small notice. I won’t beat around the bush – this is the quick and very dirty fix that turns off error reporting completely. Varien’s Object class also needs a small fix, but then you should be ready to go.

perl -p -i -e ’s/^\s*(error_reporting)\(.*\);\s*$/$1(0);/g’ `find docs/ -name “*.php”`
perl -p -i -e ’s/__toString/__invode/g’ docs/lib/Varien/Object.php

Hopefully the coming Magento 1.4 release will have fixed these issues, so a hack won’t be needed.

Uncategorized ,

  1. Brian
    January 6th, 2010 at 17:15 | #1

    While researching the code, I noticed you used “__invode” instead of the new PHP 5.3 function “__invoke”. I wanted to ask if this was intentional (to prevent it from being called) or if this was in error.

    Reference: http://us2.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.invoke

  2. hc
    January 6th, 2010 at 17:33 | #2

    Ouch, I obviously made a typo :-) So far, it looks like Magento 1.4 will run flawlessly on PHP 5.3+ though.

  3. Mike
    February 1st, 2010 at 19:29 | #3

    So this is still running rock solid?

    I want to use Magento 1.3, but REALLY don’t want to have to keep 5.2.x updated.

  1. No trackbacks yet.
Mail