php教程之phpize使用方法
安裝(fastcgi模式)的時(shí)候,常常有這樣一句命令:
/usr/local/webserver/php/bin/phpize
一、phpize是干嘛的?
phpize是什么?
phpize是用來擴(kuò)展php擴(kuò)展模塊的,通過phpize可以建立php的模塊
比如你想在原來編譯好的php中加入memcached或者ImageMagick等擴(kuò)展模塊,可以使用phpize,通過以下幾步工作。
二、如何使用phpize?
當(dāng)php編譯完成后,php的bin目錄下會有phpize這個(gè)腳本文件。在編譯你要添加的擴(kuò)展模塊之前,執(zhí)行以下phpize就可以了;
比如現(xiàn)在想在php中加入memcache擴(kuò)展模塊:我們要做的只是如下幾步
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
./configure –with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
注意./configure 后面可以指定的是php-config文件的路徑
這樣編譯就完成了,還需要做的是在php.ini文件中加入extension值
extension = “memcache.so”
注意:Cannot find config.m4.
這個(gè)錯(cuò)誤是一個(gè)很傻的錯(cuò)誤,解壓以后需要cd到文件夾,不然phpize就會報(bào)錯(cuò)
動(dòng)態(tài)編譯PHP的memcache擴(kuò)展庫,在執(zhí)行/usr/localphp/bin/phpize時(shí)出現(xiàn)了錯(cuò)誤,
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
很明顯缺少文件,需要安裝。
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz
# cd m4-1.4.9/
# ./configure && make && make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install
然后執(zhí)行以下命令進(jìn)行安裝
#/usr/local/php/bin/phpize
#./configure –prefix=/usr/local/memcached –with-libevent=/usr/local/libevent –with-php-config=/usr/local/php/bin/php-config
#make && make install
相關(guān)文章
thinkphp文件處理類Dir.class.php的用法分析
這篇文章主要介紹了thinkphp文件處理類Dir.class.php的用法,以實(shí)例形式分析了基于文件處理類Dir.class.php的自定義函數(shù)del的使用,是非常實(shí)用的技巧,需要的朋友可以參考下2014-12-12PHP讀取CSV大文件導(dǎo)入數(shù)據(jù)庫的實(shí)例
下面小編就為大家?guī)硪黄狿HP讀取CSV大文件導(dǎo)入數(shù)據(jù)庫的實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-07-07