Linux下安裝php的memcache擴展庫

 網上大部分是使phpize編譯共享PECL擴展庫,但是我這有臺機器用這方法怎麼也加載不了memcache,於是換另一種方法PECL擴展庫靜態編譯入PHP,

 

# tar xvf memcache-3.0.6.tgz

# cd /usr/local/software/php-5.3.8/ext

# mv /usr/local/src/memcache-3.0.6 ./memcache

刪除或是修改老的configure名字

# cd /usr/local/software/php-5.3.8

# mv configure configure.bak

# ./buildconf --force

# ./configure --help(從這就可以看到上面顯示有memcache參數)

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --with-curl --with-curlwrappers --with-mhash --with-mcrypt --with-gd --enable-gd-native-ttf --with-xsl --with-openssl --with-ldap --with-ldap-sasl --with-xmlrpc --without-pear --enable-zip --enable-soap --enable-mbstring --enable-ftp --enable-sockets --enable-pcntl --enable-bcmath --enable-shmop --enable-sysvsem --enable-memcache --enable-inline-optimization --enable-mbregex --with-apxs2=/usr/local/apache2/bin/apxs

(注:編譯發現configure的時候加上--disable-rpath就會報:

char *... configure: error: cannot compute sizeof (char *), 77

去掉這個參數就能正常通過,但是並不是所有的機器上都出這個錯誤;看來還是和環境有關係。

看了下文檔;這個參數貌似是運行時不去某些路徑搜索動態庫。)

 

 

# make && make instal

Note: 要運行“buildconf”腳本,需要 autoconf 2.13 和 automake 1.4+(更新版本的 autoconf 也許能工作,但不被支持)。

http://www.php.net/manual/zh/install.pecl.static.php

打開phpinfo頁面查看,

 

 

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章