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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

老帽爬新坡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值