0

I'm trying to use memcached store PHP session information, but PHP keeps telling me it can't connect:

Warning: session_start(): open(memcached:11211/sess_hitr4obt9ofmmsvk9kfl8euqt6, O_RDWR) failed: No such file or directory (2)

Next, I tried telnetting into memcached from the server it's running on by doing: memcached -l 127.0.0.1 -p 12345 -vv

After that, I connected using: telnet localhost 12345

However, that just causes telnet to hang on

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Meanwhile, the server output just sits at: <28 new auto-negotiating client connection

I've left it running for quite some time, and so far nothing has ever happened (no timeout, no connection).

Am I missing something here?

Charles
  • 50,943
  • 13
  • 104
  • 142
Rob
  • 1
  • 1
  • The very first error suggests that PHP thinks it should be using a *directory* named "memcached:11211" to store session *files*. Have you properly installed the [*correct* memcached extension](http://stackoverflow.com/a/2659060/168868) and [modified your INI settings](http://php.net/memcached.sessions)? – Charles Mar 22 '13 at 22:37
  • Here are the corresponding lines from my php.ini file. session.save_handler = memcached session.save_path = "memcached:11211" Where memcached is defined in /etc/hosts to point to the IP address of the server I have memcached installed on. Also, both the web server and memcache server are using memcached, not memcache, so I don't think that should be an issue. – Rob Mar 22 '13 at 22:47
  • Okay, apparently the CMS I was using was re-setting the session handler to files, so that's what caused the PHP error. What I still don't understand is why telnet doesn't work. – Rob Mar 22 '13 at 23:15

1 Answers1

0

That's the result of a successful connection. Try stats; if telnet successfully connected you should get a result from memcached.

Tim Hennekey
  • 2,186
  • 1
  • 13
  • 12