PHP 5.2 to 5.3 issues?

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,441
Location
London UK
We have been putting this off for a while, but it's getting near to a necessity.

Before we bite this bullet, just worried about compatibility issues with scripts - we have Wordpress installed mainly -which sadly aren't all up to date. Some Drupal and Joomla too.

Has anyone seen major issues? We know we can revert back to 5.2 if necessary.

Thanks
 
With our upgrade, we also got a new php.ini and then it's good to know that you have to enable php shorttags again, because that's disabled then.
We gave our customers a 2 weeks notice that we would be upgrading to php 5.3 and they should take care they would have upgraded to the latest version of their scripts and have backups made of their old and versions.

After upgrading to php 5.3 we got notice from a couple of users with older (don't know how much older they were) Wordpress sites, but that was fastly solved by telling them that they have to take care they always have an up2date versions according to our policy. So they updated and the problem was gone.

We upgraded on 5 servers and did not have any issues, except for some stuff which should have been upgraded anyway, being a couple of old Wordpres sites and 1 or 2 ancient forum versions and an older Joomla versions which needed upgrade.
But as said, everything could still be upgraded and was running fine afterwards.

This was all minor, we haven't seen any major problems.
 
Here is what you can expect mostly - deprecated functions.

if you have "ereg" or "eregi", you must replace them with "preg_match". Happily this happens very easy (if the regex is not veeeeery complicated).

If you have "split" you must replace it with "preg_split". Happily it also happens very easily.

I had to fix lots of sites which was migrated from another server. Here are the regexes which I wrote to do a batch fix using Notepad++ in Windows:

Code:
Find: (ereg([i]?)\(("|'))([^"']+)("|'),
Replace: preg_match\('~\4~\2',

Find: (([^_])split\(("|'))([^"']+)("|'),
Replace: preg_split\('~\4~',

Find: (ereg([i]?)_replace\(("|'))([^"']+)("|'),
Replace: preg_replace\('~\4~\2',

Not the best one, but worked for me. The ereg expressions of the sites that I migrated were very simple, so just adding ~ before and after them was enough to convert to preg.

As for the Wordpress sites - it's very easy, just update them (including the plugins). For the Joomla sites... it's not happy. I don't know for Drupal.

By the way even if you do not do the fixes listed above, the sites will still work. Just their error logs will be filled with lots of junk warnings for deprecated issues. I like to see the error logs empty :)

P.S. Instead of jumping to 5.3 you should consider upgrading directly to 5.4.
 
Last edited:
Back
Top