I recently upgraded my server to PHP 5.4 and here are errors everyone might want to know about and fixes to common problems:

1. apc crashes php on server restart - you'll need to manually upgade to 3.1.10 which is NOT the latest version on the pear/pecl upgrade channels.

2. Squirrelmail 1.4.22 will no longer handle internationalization properly when using different character sets. There is a svn version of 1.4.23 that has a workaround, but this issue is far from solved.

3. the AEgir hostmaster platform 6.x-1.8 will work with drupal 6.26, but see general note, below, and: the uc_hosting_module for Ubercart completely crashed the hostmaster platform due to some incorrect php code in 3 files which I identified on the page for that module - I posted the fix there, too - best to make those changes if using that module before upgrading to php 5.4. There are probably other examples of php coding that is not strict 5.4 compliant, too, we're just not using those modules. Be careful on this.

4. Fail2ban is now seen by the server as corrupted and in urgent need of repair - probably due to the strict nature of PHP 5.4. There is no fix for this yet, i.e. no updated Fail2ban, however it is still working for us.

In general upgrading to PHP 5.4 will cause many warnings, notices and some errors in quite a few D7 modules, but they still work for us. Good luck. PHP 5.4 is the new standard that it will be necessary to comply with in order to move to PHP 6. I'll add any more serious compatibility problems to this list as I find and seek solutions to them.

Comments

John_B’s picture

Thanks. Sounds as though for the user (rather than the developer) the upgrade to 5.4 is best avoided. I will have to be careful not to let package installers like yum or apt-get upgrade unintentionally.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

lieb’s picture

So a year an a half after the original post and issues remain.

Drupal: 7.23
PHP: 5.4.20
APC: php-pecl-apc 3.1.15

PHP Fatal error: Cannot call overloaded function for non-object in .../includes/database/query.inc on line 331

PHP Fatal error: Non-static method InsertQuery_mysql::format_username() cannot be called statically in .../sites/all/modules/admin_menu/admin_menu.inc on line 539

Disabling APC stops the errors

John_B’s picture

I never saw that on php5.4 . Did you try php 5.5 (which does not need APC as Optimizer+ is built in)?

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors