i am trying to install Memcached on windows 8 and Wamp.

i followed the guidance from here:

i.e:

Copy MSVCP71.DLL, msvcr71.dll to C:\windows\sysWOW64
Copy memcached.exe into C:\memcached
Click Windows-Key
Type: CMD
press: Ctrl-Shift-Enter
Choose yes
type: C:\memcached\memcached.exe -d install
type: C:\memcached\memcached.exe -d start
Copy php_memcache.dll to C:\wamp\bin\php\php5.3.4\ext
    Restart Apache using Wamp controls
    Enable WAMP -> PHP -> PHP Extensios -> php_memcache 

however, when i try to call the class from within my Zend 2 module i get the following error message:

  Fatal error: Class 'Memcached' not found in  

i tried calling it like this:

$memcache = new \Memcached(); 
$memcache->addServer('localhost', 11211) or die ("Could not connect");  

i also tried calling it like this:

define('MEMCACHED_HOST', '127.0.0.1');
define('MEMCACHED_PORT', '11211'); 

// Connection creation

$memcache = new \Memcache;
$cacheAvailable = $memcache->connect(MEMCACHED_HOST, MEMCACHED_PORT); 

in my php ini file i did as follows:

extension=c:\wamp\bin\php\php5.5.12\ext\php_memcache.dll 

i also went to my

Enable WAMP -> PHP -> PHP Extensios -> php_memcache 
and enabled Memcache

however, i did notice that i could not find any reference to memcache in my php info

i also ran the following test from my command line to see if the Memcached server is working:

wmic process get description, executablepath | findstr memcached.exe

it returned the correct path to the file (which means its running correctly)

so, the problem is with the PHP file.

i have tried putting this as the full path:

extension=c:\wamp\bin\php\php5.5.12\ext\php_memcache.dll 

or simply as this:

PHP Code:

extension=php_memcache.dll 

but to no avail

    That php.ini extension path

    extension=c:\wamp\bin\php\php5.5.12\ext\php_memcache.dll

    doesn't match the one you included in your initial install instructions:

    Copy php_memcache.dll to C:\wamp\bin\php\php5.3.4\ext

    Not sure if that's it.

    I have almost no experience with php on windows, but on linux, I know that any externally-compiled module needs to compiled using the same codebase as the version of PHP that is installed. If it is not, PHP tends to complain. Something like this. Given that your instructions mention php 5.3.4 and your other path is 5.5.12, this could be your problem.

    You might want to check for an error log which might provide more detail.

      Write a Reply...