Class 'Memcache' not found & PHP

Mustafa picture Mustafa · Aug 9, 2012 · Viewed 37.5k times · Source

I installed memcached by reading this article on Windows7 but unfortunately i keep getting error Fatal error: Class 'Memcache' not found in D:\xampp\htdocs\test\memcache\test.php on line 2

Line 2: $memcache = new Memcache;

Win7 64, Xampp Installed. I am using net start "memcached Server" on command line but it says service is already started.

Some other info which may help;

On php.ini file:

extension=php_memcache.dll

    [Memcache]  
    memcache.allow_failover = 1  
    memcache.max_failover_attempts=20  
    memcache.chunk_size =8192  
    memcache.default_port = 11211  

Update: phpinfo(); show dll is not loaded. Tried several different dll files so far, didn't work. Also dll is located correct. It is in the right folder as it seems.

(P.S. Some may think there are possible duplicates about this topic but there is only 1 person who followed the same instructions and had same error in SO. That question has no answer or solution since march.)

Answer

Mustafa picture Mustafa · Aug 12, 2012

I found the working dll files for PHP 5.4.4

I don't knowhow stable they are but they work for sure. Credits goes to this link.

http://x32.elijst.nl/php_memcache-5.4-nts-vc9-x86.zip

http://x32.elijst.nl/php_memcache-5.4-vc9-x86.zip

It is the 2.2.5.0 version, I noticed after compiling it (for PHP 5.4.4).

Please note that it is not 2.2.6 but works. I also mirrored them in my own FTP. Mirror links:

http://mustafabugra.com/resim/php_memcache-5.4-vc9-x86.zip http://mustafabugra.com/resim/php_memcache-5.4-nts-vc9-x86.zip