linux下為PHP擴充安裝memcache模組

來源:互聯網
上載者:User

標籤:blog   http   使用   os   art   io   

linux下為PHP擴充安裝memcache模組  

2011-09-05 13:31:00|  分類: linux|舉報|字型大小 訂閱

  sh# wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
sh# wget http://www.monkey.org/~provos/libevent-1.4.6-stable.tar.gz
sh# wget http://pecl.php.net/get/memcache-3.0.1.tgz

sh# tar -zxvf libevent-1.4.6-stable.tar.gz
sh# cd libevent-1.4.6-stable
sh# ./configure -prefix=/usr/local/libevent
sh# make
sh# make install
sh# cd ../
sh# tar -zxvf memcached-1.2.6.tar.gz
sh# cd memcached-1.2.6
sh# ./configure --prefix=/usr/local/memcache --with-libevent=/usr/local/libevent
sh# make
sh# make install

 

安裝php的memcache擴充

1 可以使用php內建的pecl安裝程式
   # /usr/local/servers/php5/bin/pecl install memcache

 

2 sh# cd ../
sh# tar -zxvf memcache-3.0.1.tgz
sh# cd memcache-3.0.1
sh# /usr/local/bin/phpize (先要執行下這個,路徑由: sh# which phpize 擷取)
sh# ./configure -enable-memcache -with-php-config=/usr/local/bin/php-config -with-zlib-dir (路徑由: sh# which php-config 擷取)
sh# make
sh# make install (提示: Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ 則成功)

安裝完後會有類似這樣的提示:
Installing shared extensions: /usr/local/servers/php5/lib/php/extensions/no-debug-non-zts-20060922/

把這個記住,然後修改php.ini,把

extension_dir = "./"
修改為
extension_dir = "/usr/local/servers/php5/lib/php/extensions/"

並添加一行
extension="no-debug-non-zts-20060922/memcache.so"

memcache監視器: http://livebookmark.net/journal/ 的 memcache.php

memcache啟動: sh# /usr/local/memcached/bin/memcached -u root -d -m 200 -l 10.2.0.88 -p 11211

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.