PHP memcache Save a Setup error in session

Source: Internet
Author: User

In PHP, using Memcache as the session's save handler will typically use the following settings:

In php.ini:

Session.save_handler = Memcache
Session.save_path = "Localhost:11211″

In the project configuration:

Ini_set ("Session.save_handler", "memcache"); Ini_set ("Session.save_path", "127.0.0.1:11211″"); On the Internet a lot of information will be written like this: Session.save_path = "Tcp://localhost:11211″ is the connection prefix added tcp://this will cause the PHP memcache module write failure, remember not to add the TCP protocol prefix!
Original: http://php.net/manual/en/memcached.sessions.phpstring session.save_path

Defines a comma separated of hostname:port entries to use for session server pool, for example "sess1:11211, Sess2:11211″.

If you want the use of ' MemcacheD ' extention not ' memcache ' (there is both diffrent extentions) for session control, you shou LD pay attention to modify php.ini

Most web resource from Google are based on Memcache because It ' s earlier version than MemcacheD. They'll say as following

Session.save_handler = Memcache
Session.save_path = "Tcp://localhost:11211″

But it's not valid if it comes to MemcacheD

You should modify PHP.ini

Session.save_handler = memcached
Session.save_path = "Localhost:11211″

Look, there is no protocol indentifier

PHP memcache Save a Setup error in session

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.