OPCache is a caching mechanism for PHP code, it will cache compiled PHP code so it is not compiled on each runtime. Ploi automatically installs OPCache for you so you only have to press one button to enable this feature. You can find this button in your server view -> PHP tab:

The speed of your website will significantly increase if you have a PHP project, there is one important thing to remember:

Whenever you enable OPCache, the code will be cached and kept cached in the FPM worker. So imagine if you deploy a new version of your website, the changes will not come through because old code is cached. This means you will have to tell the FPM worker to clean the cache.

Cleaning the FPM cache is very easy, just add this line at the end of your deploy script:

echo "" | sudo -S service php7.1-fpm reload

Change the 7.1 with the PHP version you have, by default Ploi will install 7.1 for you.

For more information about OPCache we refer you to the original PHP website.

Are you ready?
Create an account, or contact us.