Now 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.
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.