I have installed memcached binary file in Windows 7 and started it as server.
When I type wmic process get description, exetuablepath | findstr memcached.exe I get the response: memcached.exe c:\memcached\memcached.exe on command line.
When I try running the sample code on php.net, I get on my browser:
Fatal error: Class 'Memcache' not found in C:\DocumentRoot\Framework\index.php on line 3 Call Stack: 0.0010 335928 1. {main}() C:\DocumentRoot\Framework\index.php:0
So, what is it that I am doing wrong? I am using memcache.dll since memcached.dll does not exist for Windows I believe?
To enable the PHP Memcache extensions, you need to build PHP utilizing –enable-Memcache option when building, and configure it from the source. On Debian-based dispersions, you can use the php-Memcache package. To set global runtime configuration choices, specify the configuration option values within your php.
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. }
Memcached puts often-used data in RAM, allowing it to be accessed a lot faster. Caching with Memcached works like this: A web browser requests a page, and the server runs PHP code to build it. PHP asks Memcached for the page's data via a Memcached extension.
A note to anyone who runs into issues with getting memcached working on Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With