Debian installation memcached and Php5-memcache modules

Source: Internet
Author: User
1, install memcached Service and PHP extension
Apt-get Install memcached php5-memcached php5-memcache

2. Check if the memcached service is installed.
PS aux | grep memcached
You can see that the memcached is automatically started after installation. You can also view the following commands:
Netstat-tap | grep ' memcached '

3, if you need to modify the configuration file
Please go to:/etc/memcached.conf
Restart after modification
Pkill memcached
/usr/bin/memcached restart-p 11211-u nobody-l 127.0.0.1
It's best to find a shell script on the web that directly memcache start

4, the last Web server restart, Apache or Nginx fast-cgi
/etc/init.d/apache2 restart

Finally, let's take a simple example:

$mem =newmemcache;

$mem->connect ("localhost", 11211);

$mem->set (' Test ', ' Hello World ', 0,60);

echo $mem->get (' Test ');

If you can see Hello Word, it's OK.

  • 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.