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
3、添加模块
vim /usr/local/php/etc/php.ini //添加
extension = "imap.so"
重启PHP
/etc/init.d/php-fpm restart
再次查看PHP模块,可以发现已经有imap模块了
注意:./configure编译报错
报错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
报错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
2、php手动加载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