Recently changed PHP scripts run the old unchanged code

Follow

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 6 or higher:

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.

Have more questions? Submit a request

Comments

Powered by Zendesk