0

How can i find what php cache system is used by my server (APC/opcache/Zend...) ?

If I run this command line, i've no information :

php -v

PHP 5.4.45-0+deb7u5 (cli) (built: Aug 30 2016 20:15:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

If I don't see any information with this command does it mean that php is not using cache at all ?

1 Answer 1

1

Look at php -r "phpinfo();": you will see the opcache (and others), if enabled.

Remember that the value provided by php in CLI can be different than the value from Apache site.

4
  • Thank you, I know, this server is only used for CLI, what key should i look to find ? with a grep on cache, i see only memcache/session.cache/soap.wsdl_cache/realpath_cache_size/user_ini.cache_ttl/phar.cache_list Nothing else (opcache is for php 5.5+ as I understood)
    – NicoMinsk
    Oct 27, 2016 at 12:37
  • php -r "phpinfo();"|grep apc.enabled will return something if apc is active. You are right concerning opcache, but you suggest it in your sentence.
    – Dom
    Oct 27, 2016 at 12:57
  • php -r "phpinfo();"|grep apc , return nothing. Do you have any other idea ? Is it possible that i've no cache at all ?
    – NicoMinsk
    Oct 27, 2016 at 13:14
  • 1
    So no apc cache nor opcache : no cache at all. You can add it in your usual package manager : apt-get install php5-apc
    – Dom
    Oct 27, 2016 at 13:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .