OPcache Enabled

Tideways checks if the Opcache PHP extension is enabled and running on your application and otherwise generates an error.

OPcache is a bytecode optimizer that improves the PHP performance significantly. It is heavily discouraged to run a PHP application in production without OPcache enabled.

This check looks if the extension is enabled in PHP and if the INI setting opcache.enable=true and at runtime by looking at the output from the PHP function opcache_get_status (Docs) value of opcache_enabled flag.

Docker with PHP 8.4 and earlier

The official PHP image has one OPcache quirk that can bite you, OPcache extension needs to be installed explicitly, because it is not enabled by default in the base image.

That means if you have Dockerfile that extends from php image, it must always include the following line:

FROM php:8.4.17-apache2-alpine

RUN docker-php-ext-install opcache

With PHP 8.5 and higher, OPcache is now a required extension that is installed automatically.

Still need help? Email [email protected]