Updated: 16 November 2026 · Applies to: PHP 8.3 and 8.4 with OPcache (tested with PHP 8.4.27 on Debian 13); CloudLinux alt-php
If a site shows a 503 error, a 500 error or a blank page only while the OPcache extension is on, PHP is usually crashing while OPcache optimises or compiles certain code. The quickest safe fix is to keep OPcache caching but switch off its optimiser with opcache.optimization_level=0; on PHP 8.0 to 8.3, also make sure the JIT is off with opcache.jit=disable. Then update PHP and the application, since these crashes are normally bugs that newer versions fix.
1. Confirm OPcache is the cause
- Look in the PHP-FPM log or the web server error log for lines such as
child exited on signal 11 (SIGSEGV)at the moment the page fails. A segmentation fault points to a crash inside PHP or an extension, not a mistake in your code. - Switch OPcache off for a moment (see step 4) and load the page again. If the error disappears, OPcache is involved.
2. Turn off the optimiser (server administrators)
According to the PHP manual, opcache.optimization_level is a bitmask that chooses which optimisation passes run; the default 0x7FFEBFFF enables all safe ones. It is an INI_SYSTEM setting, so it cannot go in .htaccess, .user.ini or ini_set(). Put it in the OPcache settings file or the PHP-FPM pool instead:
opcache.optimization_level=0
Where to add it:
- Debian and Ubuntu:
/etc/php/8.4/fpm/conf.d/10-opcache.ini(change 8.4 to your PHP version). - AlmaLinux and Rocky Linux: the OPcache file in
/etc/php.d/(usually10-opcache.ini). - One PHP-FPM pool only: in the pool file,
php_admin_value[opcache.optimization_level] = 0. - CloudLinux alt-php (PHP Selector): according to CloudLinux, the administrator changes an extension's settings in its ini file under
/opt/alt/phpXX/etc/php.d.all/and then runscagefsctl --rebuild-alt-php-inito apply it to every account.
Restart PHP-FPM afterwards, for example:
systemctl restart php8.4-fpm
On CloudLinux, after editing the alt-php file:
cagefsctl --rebuild-alt-php-ini
3. Check the setting is active
Save this as a small test file and open it in the browser, or run it with PHP:
<?php
$c = opcache_get_configuration()['directives'];
printf("optimization_level=0x%X jit=%s\n", $c['opcache.optimization_level'], var_export($c['opcache.jit'], true));
Output in our lab before and after the change (run from the command line with -d opcache.enable_cli=1):
optimization_level=0x7FFEBFFF jit='' optimization_level=0x0 jit=''
Delete the test file when you are done. Caching still works with the optimiser off: compiled scripts are still kept in memory, PHP only skips the optimisation step.
4. The JIT on PHP 8.0 to 8.3
According to the PHP manual, before PHP 8.4 opcache.jit defaulted to tracing with opcache.jit_buffer_size at 0 (so the JIT stayed off unless a buffer was set); from PHP 8.4 the default is disable. If someone has set a JIT buffer size on your server and the crashes started then, turn the JIT off:
opcache.jit=disable
If nothing helps, disable OPcache for the affected site only while you update. A server administrator can do it per PHP-FPM pool:
php_admin_flag[opcache.enable] = off
On shared hosting with CloudLinux, untick opcache in the PHP Selector extension list if it is shown there (see How to Manage PHP Extensions in DirectAdmin via CloudLinux Selector or How to Enable or Disable PHP Extensions in Plesk via CloudLinux Selector), or ask support to change the server-level settings, which you cannot edit yourself.
5. Fix the real cause
- Update PHP to the latest release of your branch and the application and its plugins to their latest versions.
- Check other extensions that hook into the PHP engine, such as ionCube Loader, Xdebug or profilers: an outdated one together with OPcache is a common crash cause. Update them before changing OPcache further.
- Once updated, put
opcache.optimization_levelback to its default and test again.
Special case: WHMCS
According to WHMCS, OPcache should not be used on a WHMCS server: it can keep stale data in caches that WHMCS cannot manage. Here, disable OPcache for the WHMCS site instead of tuning it. See WHMCS, OPcache warnings.
Official documentation: PHP manual, OPcache runtime configuration.