Closed 2ndkauboy closed 10 years ago
a) OPcache is disabled by default in CLI mode. b) CLI wouldn't be using same caching block as your webserver. Also, don't you run PHP in CGI mode, in which php binary is executed at its own each request? It would kill caching imho.
@Majkl578 We are running the server with FastCGI (not CGI) which is the prefered method for many huge website. And we also enabled OPcache for cli. So that's not the issue.
OPCache doesn't share its cache across different processes. So it's expected that CLI process doesn't see any files cached by FastCGI processes.
FastCGI processes share the cache only if they have the common parent. (e.g. if you start one php-cgi with PHP_FCGI_CHILDREN=N, then all N processes share the same cache, if you start N php-cgi processes with PHP_FCGI_CHILDREN=0, then each process has a separate cache).
It looks like it was an issue with suPHP on our server. As soon as we deactivated suPHP the cache was shared.
We've setup opcache and it is running. When I call opcache_get_status() within a script, I can see all included files in the "script" array of the output. When I run another script, I don't see the files from the first script. Running
php -r "print_r(opcache_get_status());"
in the shell shows me not a single file.Here is our environment, if that might help:
From the phpinfo():