編譯php 5.2.14+fpm+memcached(具體操作詳解)

來源:互聯網
上載者:User

#author:zhxia

給php打上php-fpm 補丁
sudo tar jxvf php-5.2.14.tar.bz2
sudo patch -d php-5.2.14 -p1 < php-5.2.14-fpm-0.5.14.diff

編譯php
cd php-5.2.14/
sudo ./configure --prefix=/usr/local/php-5.2.14 --with-mcrypt --with-gettext --with-mysql --with-gd --with-jpeg-dir --with-png-dir --with-ttf --with-curl --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-sockets --with-png-dir --with-pdo-mysql --enable-fpm --enable-fastcgi --with-zlib --with-fpm-conf=/etc/fpm-php.conf

編譯memcached擴充
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar -xvf memcache-2.2.5.tgz
cd memcache-2.2.5/
/usr/local/php-5.2.14/bin/phpize
./configure --with-php-config=/usr/local/php-5.2.14/bin/php-config
sudo make
sudo make install

將源碼中的php.ini-dist cp 到 /usr/local/php-5.2.14/lib目錄下,並編輯,在其中加入 extension=memcache.so

===================
安裝memcached 伺服器端,需要先安裝libevent庫
先安裝 libevent庫
sudo wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
sudo tar -gunzip libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
sudo ./configure --prefix=/usr

make
make install

安裝 memcached
sudo wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
sudo tar -gunzip memcached-1.4.5.tar.gz
cd memcached-1.4.5
sudo ./configure --prefix=/usr/local/memcache-1.4.5 --with-libevent=/usr

sudo make
sudo make install

啟動 memcached
./memcached -d -u nobody -m 512 127.0.0.1 -p 11211
串連到memcached
telnet 127.0.0.1 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.