Thanks for your help so far. I've just started noticing a bunch of "zend_mm_heap corrupted" in logs, Could this be the reason?

On 02/03/2011 11:12 PM, Alex Nikitin wrote:
Short of some process going crazy, which you should check for, some psing,
top and netstat, i cant think of any reason you should ever get a connection
drop, short of a hardware failure (memory perhaps), or an experimental
kernel settings or modules or something... i cant think of any way that a
connection to would ever possibly get dropped, loopback device
never hits your network hardware...


On Thu, Feb 3, 2011 at 5:00 PM, Jostein Eriksen<>  wrote:

On 02/03/2011 10:49 PM, Adam Richardson wrote:

On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksen<>

  Both php and memcached is running on the same server.
memcached version 1.2.2
php5-memcache version 2.2.0
php version 5.2.4

here is a snippet from my code that may be of interest
$cfg['serverList'] = array('', 11211, 1, 1);
$this->memcache = new Memcache();
foreach($cfg['serverList'] as $value){
                                /** host, port, persistent, weight,
retry interval, status, failure callback */
$value[1], false, $value[2], $value[3], 2, true, array($this, 'fail'));

  Are you sure you copied this correctly?

In the code above, you set the array key 'serverList' to an array
('', 11211, 1, 1);

Then, you foreach through the values of the 'serverList' array (first
iteration, value would equal '', second, value would equal 11211,

Then, you use array notation to access the first position of $value.  In
first iteration of the foreach, $value would equal '', so
would give you '1', $value[1] would give you '2', etc.

Do you see what I'm saying? Did you forget or omit other relevant code?
I'm just having a really bad code day (in this case, I'll likely see my
error just after sending this email.)


My bad.

it should be:
'serverList' =>  array(
                                        /** host, port, weight, timeout */
                                        'default' =>  array('',
11211, 1, 1),

Didn't copy/paste the $cfg = line, so it got messed up.


PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to