phpize增加php模組

來源:互聯網
上載者:User

標籤:io   ar   for   strong   sp   檔案   2014   on   amp   

一,phpize的好處

什麼時候我們要用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了。

 

二,安裝php模組

下面我以soap安裝為例子

cd /home/tmp/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-20140613/

三,查看.so檔案,以及修改php.ini

cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20140613/

ls -al |grep soap

-rwxr-xr-x 1 root  root   763334 Feb  9 10:51 soap.so

vi /etc/php.ini

extension_dir="usr/local/php/lib/php/extensions/no-debug-non-zts-20140613/"

extension=soap.so

四,重起apache或者phpcgi或者其他

phpize增加php模組

聯繫我們

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