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.

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/zendphp7. 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?

    Reply

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 *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

If you agree to these terms, please click here.

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