溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

centos6和centos7手動(dòng)擴(kuò)展PHP的IMAP模塊

發(fā)布時(shí)間:2020-08-02 06:55:57 來源:網(wǎng)絡(luò) 閱讀:3540 作者:M四月天 欄目:web開發(fā)


一、centos6.7 x64上手動(dòng)擴(kuò)展PHP的IMAP模塊

1、準(zhǔn)備

yum install -y libc-client-devel

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

ln -s /usr/lib64/libkrb5.so /usr/lib/libkrb5.so

ln -s /usr/lib64/libssl.so /usr/lib/libssl.so


2、安裝

cd/usr/local/php-5.5.35/ext/imap/

/usr/local/php/bin/phpize

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

make

make install

centos6和centos7手動(dòng)擴(kuò)展PHP的IMAP模塊


3、添加模塊

vim /usr/local/php/etc/php.ini                     //添加

extension = "imap.so"

 

重啟PHP

/etc/init.d/php-fpm restart

 

再次查看PHP模塊,可以發(fā)現(xiàn)已經(jīng)有imap模塊了

centos6和centos7手動(dòng)擴(kuò)展PHP的IMAP模塊

 

注意:./configure編譯報(bào)錯(cuò)

報(bào)錯(cuò)1:configure: error:utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This shouldnot happen. Check config.log for additional information

解決:

yum install -y libc-client-devel

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

 

報(bào)錯(cuò)2:configure: error:Kerberos libraries not found.  Check thepath given to --with-kerberos (if no path is given, searches in /usr/kerberos,/usr/local and /usr )

解決:ln -s /usr/lib64/libkrb5.so /usr/lib/libkrb5.so

 

報(bào)錯(cuò)3:configure: error:Cannot find OpenSSL's libraries

解決:ln -s /usr/lib64/libssl.so /usr/lib/libssl.so

 

重新./configure編譯即可。




二、centos7.0.1406 x64上手動(dòng)擴(kuò)展PHP的IMAP模塊

1、安裝 php-imap

yum install -y pam-devel

cd /usr/local/src/

wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz

tar -zxvf imap-2007f.tar.gz

cd imap-2007f

make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd EXTRACFLAGS=-fPIC IP=4

 

mkdir /usr/local/imap-2007f/

mkdir /usr/local/imap-2007f/include/

mkdir /usr/local/imap-2007f/lib/

cp c-client/*.h /usr/local/imap-2007f/include/

cp c-client/*.c /usr/local/imap-2007f/lib/

cp c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a

 

2php手動(dòng)加載php-imap

cd /usr/local/php-7.1.0/ext/imap/

/usr/local/php/bin/phpize

./configure -with-imap=/usr/local/imap-2007f -with-php-config=/usr/local/php/bin/php-config --with-imap-ssl=/usr

make

make install

centos6和centos7手動(dòng)擴(kuò)展PHP的IMAP模塊



注意:./configure編譯報(bào)錯(cuò)

報(bào)錯(cuò):configure: error:Cannot find OpenSSL's libraries

解決:確認(rèn)已安裝過openssl、libssl-dev 包,但是還是會(huì)提示該錯(cuò)誤

find / -name libssl.so                         //查找到路徑為:/usr/lib64/libssl.so

ln -s /usr/lib64/libssl.so /usr/lib


重新編譯即可



3、添加php-imap模塊

vim /usr/local/php/etc/php.ini                      //添加

extension ="imap.so"

 

重啟PHP

/etc/init.d/php-fpm restart

 

再次查看PHP模塊,可以發(fā)現(xiàn)已經(jīng)有imap模塊了

centos6和centos7手動(dòng)擴(kuò)展PHP的IMAP模塊





向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI