Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class 'Memcache' not found & PHP

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.)

like image 527
Mustafa Avatar asked Aug 09 '12 12:08

Mustafa


People also ask

How do I know if memcache is installed?

If you want to check whether memcache is running you can run : ps -ef | grep memcache This will work on Linux as long as you have the correct permissions (I ran it as root).


1 Answers

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

like image 178
Mustafa Avatar answered Sep 28 '22 14:09

Mustafa