Issue

After upgrading to Zend Server for IBM i version 8.5, Zend OPcache may fail to load.  In the Zend Server User Interface, the following message is displayed on the Administration -> Components tab:

Warning: The extension 'Zend OPcache' is not loaded

Also, on the PHP -> phpinfo() tab, there is no section to describe the directives for OPcache.

Environment

Zend Server for IBM i version 8.5 or later, upgraded from a previous version 8.0.2 or older of Zend Server, running on any supported version of IBM i.

Resolution

Note: This procedure requires a restart of Zend Server

Please schedule this activity for a time when your web site can be unavailable for a couple of minutes.

Please locate this file:

/usr/local/zendsvr6/etc/conf.d/opcache.ini

Before making any changes in this file, please make sure to back it up.

The upgrade installer updates this file to have the default directives.  It also attempts to retain any old directives that may have existed in the previous version.  In the opcache.ini file, look at the very end to see if this section is present:

;******************************************************************
;* Directives from old configuration that do not exist in current *
;* installation are placed below (probably deprecated) *
;******************************************************************

zend_extension=opcache.so

The zend_extension directive is not needed, and causes PHP to try to load the opcache.so file from the wrong directory. The first line in the new configuration is this:

; register the extension to be loaded by Zend Extension Manager
zend_extension_manager.dir.opcache='/usr/local/zendsvr6/lib/opcache'

That line will cause the opcache.so file to be found in the correct directory, but it is overridden by the later inclusion of zend_extension.  The zend_extension line of code can be removed simply by placing a semicolon at the beginning of the line, which will make it a comment:

;zend_extension=opcache.so

After making this change (remember to always back up any configuration file before changing it), save the file and restart Zend Server.

After the restart, the Administration -> Components tab in the Zend Server User Interface should show that Zend OPcache is loaded.  Also, the PHP -> phpinfo() tab will include a section to describe the directives for Zend OPcache.