We are using PHP + FPM 8.2 + OPCache. In the past, we use https://www.repairrar.com/opcache.php to check its status. But today it returns an empty page. Although it shows an empty page, I view the page source and find its contents are about 3.3MB, but they are just not show in the browser. I tried Chrome and FireFox, but show empty contents.
I also write a small PHP file
<?php
echo '<pre>' , var_dump(opcache_get_status(false)) , '</pre>';
?>
When visit https://www.repairrar.com/opcache-get-status.php, it shows the OpCache is enabled and performed properly:
array(8) {
["opcache_enabled"]=>
bool(true)
["cache_full"]=>
bool(false)
["restart_pending"]=>
bool(false)
["restart_in_progress"]=>
bool(false)
["memory_usage"]=>
array(4) {
["used_memory"]=>
int(446911376)
["free_memory"]=>
int(626183176)
["wasted_memory"]=>
int(647272)
["current_wasted_percentage"]=>
float(0.0602819025516510009765625)
}
["interned_strings_usage"]=>
array(4) {
["buffer_size"]=>
int(134217728)
["used_memory"]=>
int(52098200)
["free_memory"]=>
int(82119528)
["number_of_strings"]=>
int(242556)
}
["opcache_statistics"]=>
array(13) {
["num_cached_scripts"]=>
int(10741)
["num_cached_keys"]=>
int(15444)
["max_cached_keys"]=>
int(130987)
["hits"]=>
int(167134669)
["start_time"]=>
int(1733489514)
["last_restart_time"]=>
int(0)
["oom_restarts"]=>
int(0)
["hash_restarts"]=>
int(0)
["manual_restarts"]=>
int(0)
["misses"]=>
int(11569)
["blacklist_misses"]=>
int(0)
["blacklist_miss_ratio"]=>
float(0)
["opcache_hit_rate"]=>
float(99.99307851607164820961770601570606231689453125)
}
["jit"]=>
array(7) {
["enabled"]=>
bool(false)
["on"]=>
bool(false)
["kind"]=>
int(5)
["opt_level"]=>
int(4)
["opt_flags"]=>
int(6)
["buffer_size"]=>
int(0)
["buffer_free"]=>
int(0)
}
}
And below is the php.ini file(I check the change history and it has not be changed since Opcache.php return visible contents):
; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
allow_url_fopen = On
allow_url_include = Off
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 1000
max_input_time = 1000
max_input_vars = 1000
memory_limit = 512M
post_max_size = 64M
session.gc_maxlifetime = 2880
#session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 64M
zlib.output_compression = Off
session.save_path = "/var/cpanel/php/sessions/ea-php82"
; The gloabal 10-opcahce.ini has already enable opcache, so it is not necessary to enable it here again.
; Enable opcache here will cause 'Zend OPcache can't be temporary enabled' warning in PHP. So the following
; line is commented out
; opcache.enable=1
It looks like the issue is with how the page is rendering in the browser, even though the content is still there. You could try clearing your browser cache or disabling extensions to see if that helps. Also, testing the page in different browsers might give more insight. If that doesn’t work, check the server logs for any errors or review PHP-FPM and memory settings, as there could be something affecting how the page is being served.
You're seeing a blank OPcache page, but the page source still has content.
Disable Output Buffering:
Set the Correct Content-Type: Ensure the page is rendered as HTML
Enable Error Reporting: Turn on error reporting in your script
Check OPcache Settings: Verify that OPcache is enabled in php.ini
Clear your browser cache or test in Incognito mode to avoid interference.
Run this basic script to see if output works:
Confirm OPcache is enabled: php -i | grep opcache