Docs / Performance Optimization / How to Enable OPcache for PHP

How to Enable OPcache for PHP

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 249 views · 1 min read

OPcache dramatically improves PHP performance by caching compiled bytecode.

Check If Enabled

php -m | grep OPcache

Enable

Edit /etc/php/8.3/fpm/php.ini:

opcache.enable=1\nopcache.memory_consumption=128\nopcache.interned_strings_buffer=16\nopcache.max_accelerated_files=10000\nopcache.revalidate_freq=60\nopcache.fast_shutdown=1
systemctl restart php8.3-fpm

Monitor

Use a PHP script to check OPcache status or install a monitoring tool like opcache-gui.

Was this article helpful?