Memcache class not found and PHP

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

Line 2: $memcache = new Memcache;

Win7 64, installed Xampp. I use net start "memcached Server" on the command line, but it says that the service is already running.

Additional information that may help;

In 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 does not load. Tried several different dll files so far, didn't work. Also the dll is right. It seems to be in the correct folder.

(PS Some might think that there are possible duplicates of this topic, but there are only 1 people who followed the same instructions and had the same error in SO. There is no answer or solution after the march.)

+17
php memcached xampp
Aug 09 2018-12-12T00:
source share
6 answers

I found working DLL files for PHP 5.4.4

I do not know how stable they are, but they work for sure. Loans go 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

This is version 2.2.5.0, which I noticed after compiling it (for PHP 5.4.4).

Please note that this is not 2.2.6, but works. I also mirrored them on my 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

+10
Aug 12 2018-12-12T00:
source share

Add this to your php.ini:

 extension="php_memcache.dll" 

and restart apache

+6
Aug 14 2018-12-12T00:
source share

Memcached uses a standard text interface, so it can be used without a module.

 // connect $link = fsockopen($host,$port,$errno,$errst,$timeout); // set $data = sprintf("set %s 0 %s %s\r\n%s\r\n", $key,$expire,strlen($value),$value); fwrite($link,$data); $result = trim(fgets($link)); if ($result == 'ERROR') { // :( } // get $data = sprintf("get %s\r\n",$key); fwrite($link,$data); $line = rtrim(fgets($link)); if ($line != 'END') { return rtrim(fgets($link)); } 
+5
Aug 15 2018-12-12T00:
source share

So, I looked at the solution. Here you can download some compiled extensions.

http://downloads.php.net/pierre/

The problem is that there is currently no memcache extension for PHP 5.4 . this is the problem why your extension cannot be downloaded. You need an extension for the correct version of PHP and Tead Safe for Windows.

Thus, the easiest way is to work with PHP 5.3 if you need an extension.

The newest version of memcache is version 3.0.6 , but its beta version can be seen here.

http://pecl.php.net/package/memcache

You can try to take the beta version and compile it with your Windows system. But its a lot of work.

+4
Aug 11 2018-12-12T00:
source share

Also, the problem may be loading a different version of the php module somewhere in the apache.conf files. It is necessary to check the duplicated directives "LoadModule php ...", and if this module is compiled to fix the apache version. This seems to sound simple, but not when you have multiple php versions on the same machine :) Or it could be a SElinux problem.

0
Feb 14 '15 at 9:19
source share

The xampp version for Windows is 32 bit, you should use 32bit memcache.dll

I want it to be useful to you!

0
Oct 10 '16 at 8:20
source share



All Articles