安裝步驟以下:php
1 cd /Applications/MAMP/bin/php/php5.4.34 2 mkdir include 3 cd include 4 #下載php源碼包 5 wget http://pa1.php.net/get/php-5.4.34.tar.gz/from/this/mirror 6 tar xvzf php-5.4.34.tar.gz 7 mv php-5.4.34 php 8 cd php/ext 9 /Applications/MAMP/bin/php/php5.4.34/bin/pecl download memcache 10 tar xvzf memcache-2.2.7.tgz 11 cd memcache-2.2.7 12 /Applications/MAMP/bin/php/php5.4.34/bin/phpize 13 cd ../.. 14 ./configure 15 cd ../../bin 16 ./pecl i memcache
擴展編譯完成,接下來是編輯php.ini文件,加入extension=php_memcache.sothis