Home > PHP > Upgrading PHP 5.2 to 5.3 – Bad Move

Upgrading PHP 5.2 to 5.3 – Bad Move

September 5, 2010 Posted by KP

Update: please see my new post: PHP 5.3 Isn’t That Bad

MediaWiki doesn’t like PHP 5.2.8, I had to upgrade PHP to install MediaWiki. PortUpgrade upgraded PHP to 5.3.3 successfully, but it got problems while upgrading PHP modules, it’s mainly caused by the change of PCRE package which became part of PHP on FreeBSD since 5.3. If you need to upgrade to PHP 5.3.x, make sure you read /usr/ports/UPDATING and this thread.

Basically, PCRE needs to be included explicitly when compile PHP, otherwise other packages can’t be compiled due to the missing /usr/local/include/php/ext/pcre/pcre.h. Add the following line to /etc/make.conf if you use ‘make install’, or to /etc/pkgtools.conf if you use portupgrade.

WITH_BUNDLED_PCRE=”YES”

Although I made it work finally, I really don’t like the result. PHP5.3.3 is quite different from its predecessors, I got huge amount of log errors – it’s a pain if you are running all kinds of third party scripts on your server. So far, I think the latest version of PHP 5.2 is a much better solution unless you only run home-made scripts, or all your third-party scripts have been tailored for PHP5.3.

I have all kinds of very old scripts on my server and have no plan to upgrade some of them in the foreseeable future.

The odd thing is that error_reporting didn’t seem to suppress any PHP warnings or deprecated errors regardless of any options, the error logs are so crazy that I had to turn off log_errors, obviously this can only be a temporary solution, I may downgrade PHP soon.



Related Posts:

Filed Under: PHP

Comments are closed.



Archives