1

I am trying to use memcached with php 5.5, is it possible?

I have downloaded php_memcache.dll and put it inside the php/ext/ folder and also added a new line of code in side php.ini extension=php_memcache.dll. But still it is not working.

When I try to call $memcache = new Memcache; the following occurs.

Fatal error: Class 'Memcache' not found in C:\xampp\htdocs\rnd\memcache\index.php on line

hakre
  • 193,403
  • 52
  • 435
  • 836
Jitendra Yadav
  • 896
  • 1
  • 6
  • 14

1 Answers1

0

You can try creating an php_info page to check if the module is loaded.

info.php

<?php phpinfo();?>

ref: http://www.phpinfofile.com/

I'm using PHP 5.5.9 and memcache works fine. Note that i'm using a *nix machine though.

memcache

memcache support => enabled
Active persistent connections => 0
Version => 2.2.7
Revision => $Revision: 327750 $

Directive => Local Value => Master Value
memcache.allow_failover => 1 => 1
memcache.chunk_size => 8192 => 8192
memcache.default_port => 11211 => 11211
memcache.default_timeout_ms => 1000 => 1000
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => standard => standard
memcache.max_failover_attempts => 20 => 20
gianebao
  • 17,718
  • 3
  • 31
  • 40
  • I have got an error `"PHP Startup: memcache: Unable t initialize module. Module compiled with module API=20090626 PHP compiled with module api=20100525 These options need to match"` when i restart the apache. – Jitendra Yadav Apr 25 '14 at 10:38
  • are you using WAMPP? XAMPP? or from binary? – gianebao Apr 25 '14 at 10:40
  • Then i recommend you to get your answer from: http://stackoverflow.com/questions/10347743/windows-php-memcache-dll-for-php-5-4. You can get a 5.5 version from http://windows.php.net/downloads/pecl/releases/memcache/3.0.8. – gianebao Apr 25 '14 at 10:51