0

I'm trying to use memcache to handle session in PHP.

I still want to use

<?php
    session_start();
    $_SESSION['name']="someone's name";
    session_destroy();
?>

style of starting, registering and destroying session.

This is what I have in /etc/php5/apache2/php.ini

extension = memcache.so
memcache.allow_failover = 1
memcache.redundancy = 1
memcache.session_redundancy = 2

session.save_handler = memcache
session.save_path = "tcp://NOT.LOCALHOST.SERVER.IP:11211"
session.use_only_cookies = 1
session.auto_start = 0
session.cookie_lifetime = 0 
session.cookie_path = /

and I'm getthing this error:

Notice: session_start(): Server NOT.LOCALHOST.SERVER.IP (tcp 11211) failed with: Connection refused (111) in somefile.php on some line.

What should I do to resolve this problem?

1 Answer 1

2

You should verify if

  • Your remote server's 11211 port is open
  • If your local server is authorized to access that port

I can't comment yet, so I have to post this as an answer.

Sign up to request clarification or add additional context in comments.

6 Comments

11211 port are open and authorized to access that port
Is memcached enabled on the remote server ?
Yes it is enabled. I tried to start memcached again and it says that it is already running.
should I configure on memcached access IP list in some conf file?
Thank you the problem has solved. The memcached was not properly run.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.