Memcache issue

Hello,
I am using PHP to connect to memcache.

I connect memcache service in the PHP code as follows:
$memcache = new Memcache;
$memcache->connect(‘127.0.0.1’, 11211); //connect to memcached server

Then when I connect to NGX server, I got 500 or 502 error.

However, if I run the memcache using php test.php directly, I can
connect to memcache server successfully.

I am using php-fpm.

Does anyone encounter the similar issue before?

Thanks,
Yanxin

What is in error_log ?


Igor S.

05.05.2011, 19:52, “Yanxin Z.” [email protected] ():

Thank you for your help, Igor.

The log is

1815426 2011/05/05 09:05:09 [notice] 13424#0: 15
"/api/1.0/(.
)/upload_internal" matches “/api/1.0/
web/upload_internal”, client: 10.1.4.250, server: localhost, request:
“POST /api/1.0/web/upload_internal HTTP/1.1”, host: “10.1.4.243”
1815427 2011/05/05 09:05:09 [notice] 13424#0: *15 rewritten data:
“/api/1.0/web/upload.php”, args: “”, client: 10.1.4.250, server:
localhost, request: “POST /api/1.0/web/upload_internal HTTP/1.1”,
host: “10.1.4.243”
1815428 2011/05/05 09:05:09 [error] 13424#0: *15 recv() failed (104:
Connection reset by peer) while reading response header from upstream,
client: 10.1.4.250, server: localhost, request: “POST /
api/1.0/web/upload_internal HTTP/1.1”, upstream:
“fastcgi://127.0.0.1:9000”, host: “10.1.4.243”
1815429 2011/05/05 09:05:09 [info] 13424#0: *15 client 10.1.4.250 closed
keepalive connection

Hello Igor,
Thank you for your direction.

I searched for “nginx 104: Connection reset by peer”

In the forum
http://forum.slicehost.com/comments.php?DiscussionID=433

Someone suggest to restart fastcgi.

I did restart php-fpm then, memcached is working now.

Hopefully my post is helpful to other members.
Yanxin