: 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:
- $ Mem = newMemcache;
- $ Mem-> connect ("localhost", 11211 );
- $ Mem-> set ('test', 'Hello World', 0, 60 );
- 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.