phpize增加php模組
一、phpize是幹嘛的?
phpize是用來擴充php擴充模組的,通過phpize可以建立php的外掛模組
?
什麼時候我們要用phpize呢?
我們在安裝php時:
'./configure' '--prefix=/usr/local/php' '--with-mysql=/usr/local/mysql' '--with-zlib-dir' '--with-freetype-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--with-gd' '--enable-ftp' '--with-iconv' '--with-gettext' '--with-curl' '--enable-fastcgi' '--with-openssl'
後面根的參數是我們要的模組,但是隨著工作的需要,我們還要在加些模組,又不想重新編譯php,這些我們就可以用phpize了。
?
二、如何使用phpize?
當php編譯完成後,php的bin目錄下會有phpize這個指令檔。在編譯你要添加的擴充模組之前,執行以下phpize就可以了;
?
安裝php模組
下面我以soap安裝為例子
cd /home/zhangy/php-5.2.6/ext/soap??????????????? #ext目錄下面放的是php的模組庫
/usr/local/php/bin/phpize
#確定php-config檔案在不在,調用php-config,安裝後.so檔案會自動放到extension_dir裡面
./configure --enable-soap? --with-php-config=/usr/local/php/bin/php-config
make && make install
安裝完後會有這樣的東西
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions:???? /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
三,查看.so檔案,以及修改php.ini
cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
ls -al |grep soap
-rwxr-xr-x 1 root? root?? 763334 Feb? 9 10:51 soap.so
vi /usr/local/php/lib/php.ini
在載入模組的地加上一行extension=soap.so
四,重起apache或者phpcgi或者其他