在Linux上安裝memcached(以ubuntu 為例)

sudo apt-get update
sudo apt-get upgrade

Step1.先把LAMP開發環境裝好
可以參考另一篇文章:在ubuntu(12.0LTS)上安裝Apache+Php+Mysql+Phpmyadmin

Step2.安裝必要套件

sudo apt-get install mysql-server php5-mysql php5 php5-memcache
sudo apt-get install memcached
sudo apt-get install php-pear
sudo apt-get install build-essential

Step3.使用PECL安裝memcache

sudo pecl install memcache
sudo service apache restart

如果出現:Enable memcache session handler support? [yes] :的字樣,請輸入yes

step4.把memcache加入memcache.ini

echo "extension=memcache.so" | sudo tee /etc/php5/conf.d/memcache.ini

step5.做最後確認

ps aux | grep memcache
echo "stats settings" | nc localhost 11211

以上就是安裝memcached整個步驟,供參考。

相關文章:
https://www.digitalocean.com/community/articles/how-to-install-and-use-memcache-on-ubuntu-12-04