简体   繁体   中英

opcache has zero hits with cgi/fastcgi

I'm trying to get opcache working on my server that is hosting a website in apache2. I'm running debian 8. However it seems to be hitting zero of the scripts. I've already tried to change the php mode to cgi only but this didn't change anything. I've also tried to disable suPHP with the following command

a2endismod suPHP

again this didn't do anything for the problem. Does anyone happen to know what could be causing this?

在此输入图像描述

This was already answered here

To quote:

This looks like you are using cgi (FastCGI) rather than mod_php5. The shared memory area (SMA) is used for both, but it only persists request-to-request for the latter.

However, I should add that enabling following:

opcache.file_cache=/var/tmp/php/opcache
opcache.file_cache_only=1

made OPcache work with my setup - which is Apache+php as CGI/FastCGI (NOT php-fpm). Obviously this caching mechanism is filebased, not SHM (make sure /var/tmp/php/opcache is accessible by webserver, might need 777 permissions).

You won't be seeing any cache hits/misses in the statistics after enabling the above, since - again - we disabled SHM Cache.

PS. sorry for necroposting, was just looking for a solution for a similar issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM