當前位置:編程學習大全網 - 源碼下載 - 如何擴展PHP的IMAP模塊

如何擴展PHP的IMAP模塊

如果對php進行模塊擴展,重新編譯PHP,這個過程比較痛苦,我的方法都是采用編譯模塊為*.so的方式,簡單,方便,不用去其他地方找模塊源碼包,php源碼自帶了。

1、進入安裝目錄

cd /path/ext/imap

/usr/local/webserver/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config

就是到這步報錯了,如果妳碰到這樣的錯誤:

This c-client library is built with Kerberos support.

Add --with-kerberos to your configure line. Check config.log for details

utf8_mime2text() has new signature

以上2個錯誤都是由於缺少 libc-client-* 軟件包引起,由於我是Centos系統,就直接yum升級吧

yum -y install libc-client-*

安裝完畢後,再次編譯,

./configure --with-php-config=/usr/local/webserver/php/bin/php-config

這次的錯誤不壹樣,如下:

configure: error: Kerberos libraries not found.

Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )

既然提示少參數,就加上該參數吧,

./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-kerberos=/usr

註意:這裏有3個路徑可以選擇,於是就壹個壹個試壹下,很幸運的是前面2個都不能編譯通過,只有 --with-kerberos=/usr 可以,但是還是有報錯,如下:

This c-client library is built with SSL support

看來離希望越來越近了,於是就加上 --with-imap-ssl=/usr 參數,終於編譯通過了,真不容易。

最後完整的編譯 imap 模塊參數如下:

./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-kerberos=/usr --with-imap-ssl=/usr

make

make install

  • 上一篇:如何查看spring源碼
  • 下一篇:易語言的選擇框如何記住選項,也就是說,我選擇了哪些選項什麽的,下次打開還是那些選項會保存!我要源碼
  • copyright 2024編程學習大全網