PHP to put the session into the Memcached setting method

Source: Internet
Author: User
Tags ini memcached port number

This article mainly introduced the PHP will session into the Memcached setting method, needs the friend may refer to under

Can modify the php.ini file: 1, modify the code in PHP.ini as follows: Session.save_hander = Memcache;     Session.save_path = "Tcp://host: port number";//For example: Session.save_path = "tcp://127.0.0.1:11211";   2, normal access to the value of the session is OK.      You cannot modify the php.ini file: A, dynamically modify the settings in php.ini. The code is as follows: Ini_set (' Session.save_hander ', ' memcache ');   Ini_set (' Session.save_path ', ' tcp://127.0.0.1:11211 ');    Description: Ini_set () is only valid for the current PHP page, and will not modify the php.ini file itself, and will not affect other PHP pages.   b, normal access to the value of the session is OK. The main purpose of Memcache and session comparison Memcache is to ease the database pressure and speed up, so it is a stateless data (stateless data: the current data is not tied to a user, such as: Lee's data, Richard can be taken out,   As long as you know the corresponding key value can be the session data is bound to the user and is therefore a stateful data. Memcache security will be memcache into the intranet, with a firewall to prevent external access to memcached data changes frequently, with instability, do not need real-time warehousing, security, low

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.