Tuesday 5 December 2017

apache - How to check if memcache or memcached is installed for PHP?

itemprop="text">


How do I test if href="http://pecl.php.net/package/memcache" rel="noreferrer">memcache or
rel="noreferrer">memcached (for PHP) is installed on my Apache
webserver?





Memcache is a caching daemon designed especially
for
dynamic web applications to decrease database load by
storing
objects in memory.




Answer




You can look at phpinfo() or check if any of
the functions of memcache is available. Ultimately, check whether the
Memcache class exists or
not.




e.g.



if(class_exists('Memcache')){

// Memcache is enabled.
}


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...