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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.