Issue

A PHP script is changed.  When the script is run in the browser, it is expected to run as changed, but instead it runs the same as before the change.

Environment

Any version of Zend Server for IBM i running on any supported version of IBM i.

Resolution

This can happen if code caching is active for OPcache (formerly Optimizer+).  The old code is in the byte code cache, and does not contain the changes made to the source.  Clearing the cache will allow the script to be cached with the new source.

For Zend Server version 2020.x, 2021.x or higher:

To manually clear the OPcache (formerly Optimizer+) cache, please go to the Zend Server administrator at:

http://<your IBM i IP address>:10101/ZendServer/ 

Go to Configurations -> Components. Find 'Zend OPcache' on the list of components, and click the broom icon (Clear cache) at the far right on the same line in the table. Click OK in the pop up to finish. This will clear the cache, and the next time your changed script is run the changed version will be loaded into the cache. The OPcache cache can be cleared at any time, and does not require a restart of PHP.

Clearing the cache will allow your changed code to run with the expected changes.

For Zend Server version 9.1.x, 2018.0.x, 2019.0.x or higher:

To manually clear the OPcache (formerly Optimizer+) cache, please go to the Zend Server administrator at:

http://<your IBM i IP address>:10091/ZendServer/   (If a parallel version of Zend Server 6 - 8.5.x is not installed the port will be 10081 rather than 10091)

Go to Configurations -> Components. Find 'Zend OPcache' on the list of components, and click the broom icon (Clear cache) at the far right on the same line in the table. Click OK in the pop up to finish. This will clear the cache, and the next time your changed script is run the changed version will be loaded into the cache. The OPcache cache can be cleared at any time, and does not require a restart of PHP.

Clearing the cache will allow your changed code to run with the expected changes.

For Zend Server version 6 - 8.5.x:

To manually clear the OPcache (formerly Optimizer+) cache, please go to the Zend Server administrator at:

http://<your IBM i IP address>:10081/ZendServer/

Go to Configurations -> Components. Find 'Zend OPcache' (or 'Zend Optimizer+' for versions prior to 6.3) on the list of components, and click the broom icon (Clear cache) at the far right on the same line in the table. Click OK in the pop up to finish. This will clear the cache, and the next time your changed script is run the changed version will be loaded into the cache. The OPcache cache can be cleared at any time, and does not require a restart of PHP.

Clearing the cache will allow your changed code to run with the expected changes.

For Zend Server version 5:

To manually clear the Optimizer+ cache, please go to the Zend Server administrator at:

http://<your IBM i IP address>:10088/ZendServer/

Go to Server Setup -> Components. Find "Zend Optimizer+" on the list of components, and click the "Clear" link on the "Zend Optimizer+" line in the table.  This will clear the cache, and the next time your changed script is run the changed version will be loaded into the cache.  The Optimizer+ cache can be cleared at any time, and does not require a restart of PHP.

Clearing the cache will allow your changed code to run with the expected changes.