Jump to content

Memcache is in my phpinfo but can't connect


mapleleaf

Recommended Posts

I installed Memcache locally and I see it in phpinfo but it fails to connect

 

<?php
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
?>

 

In my php.ini it is enabled. What did I miss in the set up process. I restarted the server.

 

 

Relevant section of the php.ini

memcache
memcache support	enabled
Active persistent connections 	0
Revision 	$Revision: 1.94 $

Directive	Local Value	Master Value
memcache.allow_failover	1	1
memcache.chunk_size	8192	8192
memcache.default_port	11211	11211
memcache.hash_function	crc32	crc32
memcache.hash_strategy	standard	standard
memcache.max_failover_attempts	20	20

 

Any thoughts much appreciated

That is a good question.

I thought I had it downloaded and installed. It seems that PHP thinks it is there because the extension is loaded

 

<?php if(extension_loaded('Memcache')){
  // Memcache is enabled.
  echo 'Yes!!';
}

came back with Yes!!

 

What other steps do I need to take to get in running? Using Mamp.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.