php教程之phpize使用方法

來源:互聯網
上載者:User

 phpize是用來擴充php擴充模組的,通過phpize可以建立php的外掛模組,下面介紹一個他的使用方法,需要的朋友可以參考下

安裝(fastcgi模式)的時候,常常有這樣一句命令: 代碼如下:/usr/local/webserver/php/bin/phpize  一、phpize是幹嘛的? phpize是什嗎?phpize是用來擴充php擴充模組的,通過phpize可以建立php的外掛模組比如你想在原來編譯好的php中加入memcached或者ImageMagick等擴充模組,可以使用phpize,通過以下幾步工作。 二、如何使用phpize? 當php編譯完成後,php的bin目錄下會有phpize這個指令檔。在編譯你要添加的擴充模組之前,執行以下phpize就可以了;比如現在想在php中加入memcache擴充模組:我們要做的只是如下幾步 代碼如下:tar zxvf memcache-2.2.5.tgzcd memcache-2.2.5//usr/local/webserver/php/bin/phpize./configure –with-php-config=/usr/local/webserver/php/bin/php-configmakemake install  注意./configure 後面可以指定的是php-config檔案的路徑這樣編譯就完成了,還需要做的是在php.ini檔案中加入extension值 代碼如下:extension = “memcache.so” 注意:Cannot find config.m4.這個錯誤是一個很傻的錯誤,解壓以後需要cd到檔案夾,不然phpize就會報錯動態編譯PHP的memcache擴充庫,在執行/usr/localphp/bin/phpize時出現了錯誤, 代碼如下: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然後執行以下命令進行安裝#/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 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.