Resources for Upgrading to PHP 7 on IBM i

PHP 7 Zend ServerNow that speedy PHP 7 is available for IBM i, we’ve been helping clients upgrade to this long-awaited release. Here are some resources for performing this popular upgrade.

June 2020 Update: Companies that use PHP on IBM i now have two options when upgrading to PHP 7—Zend Server or the no-charge RPM PHP.

This post discusses PHP 7 upgrades on Zend Server, although many of the resources also apply to RPM PHP.

First, we recommend Rod Flohr’s article Migrate to Zend Server 9 from Previous Versions, which contains both basic instructions and special tips.

The process is more of a migration than an upgrade. Because PHP 7 installs to a different location than old releases, applications can be tested in parallel using old and new PHP simultaneously. Thus, even shops having only one IBM i partition can test PHP 7 before going live.

The new locations are the ZENDPHP 7 library and the IFS directories /www/zendphp7 and /usr/local/zendphp7 (or /QOpenSys/pkgs/bin for RPM packages). The old locations were ZENDSVR6, /www/zendsvr6, and /usr/zendsvr6. Be sure to apply permissions and test them according to what worked in the old locations.

We haven’t seen any removal of core or critical functionality from PHP. Some older and less common functionality, however, that was deprecated (marked for future removal) in previous releases has been removed in PHP 7.

To see what functionality has been removed or changed, see these resources:

One backward-incompatible change was the removal of deprecated bundled extension ext/mysql; functions starting with “mysql_”, such as mysql_connect(), no longer work. The extension ext/mysql could be added back, if needed, as an ordinary PECL extension, but we recommend using the superior ext/mysqli (“mysql improved”) or PDO, which both support prepared statements (essential for security) and have been available since PHP 5.

Db2 functions such as db2_connect(), db2_prepare(), db2_execute() work as they did in PHP 5. Applications should be tested, of course, but there are no known issues with ibm_db2 in PHP 7 at this time.

Let us know if you’d like help migrating to PHP 7 and realizing its benefits in your shop.

1 reply
  1. Paul Foster
    Paul Foster says:

    Thanks Alan, I’ve installed zendphp7 and it is generally performing well.

    I’ve noticed one change …. php.log is now full of the following warning message:
    “PHP Warning: Module ‘ibm_db2’ already loaded in Unknown on line 0”

    This caused problems with return values as they are preceded by the warning message. Turning off display_errors in php.ini fixed this (probably should be off anyway) but the log is getting hammered even with error_reporting set to E_ERROR|E_CORE_ERROR|E_RECOVERABLE_ERROR.

    Any thoughts on how this can be prevented?


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.