← ServerPilot Docs

How to Disable the PHP Opcache

In the examples shown, replace "X.Y" with your app's PHP version (for example, "8.3").

The purpose of PHP's opcache is to speed up your scripts and save CPU by storing compiled PHP scripts in memory.

If you need to save memory at the cost of having slower apps and increased CPU usage, you can disable the opcache.

To disable PHP's opcache, SSH into your server as root and edit the following file:

/etc/phpX.Y-sp/conf.d/opcache.ini

Add this line to the end of the file:

opcache.enable=0

Finally, restart PHP with this command:

sudo service phpX.Y-fpm-sp restart
Last updated: November 20, 2023

Launch your first site in 5 minutes