Debian install memcached and php5-memcache module

Source: Internet
Author: User
: This article mainly introduces the Debian install memcached and php5-memcache module, for PHP tutorials interested in students can refer. More please support: http://www.webyang.net/Html/web/article_171.html

1. install the memcached service and php extension
Apt-get install memcached php5-memcached php5-memcache
2. check whether the memcached service is installed.
Ps aux | grep memcached
We can see that memcached is automatically started after it is installed. You can also view the following command:
Netstat-tap | grep 'memcached'
3. to modify the configuration file
Go to:/etc/memcached. conf
Restart After modification
Pkill memcached
/Usr/bin/memcached restart-p 11211-u nobody-l 127.0.0.1
It is best to find a shell script on the Internet, which can be directly memcache start
4. after the web server is restarted, the fast-cgi of apache or nginx
/Etc/init. d/apache2 restart

Let's end with a simple example:

 
 
  1. $ Mem = newMemcache;
  2. $ Mem-> connect ("localhost", 11211 );
  3. $ Mem-> set ('test', 'Hello World', 0, 60 );
  4. Echo $ mem-> get ('test ');

If you can see hello word, it will be OK.

The above introduces Debian to install memcached and php5-memcache module, including the content of the aspect, hope to be interested in PHP Tutorial friends help.

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.