安装imap模块前需要先安装imap所需的库
centos
yum install libc-client-devel
debian
apt-get install libc-client-dev
首先进入php安装目录的imap目录
/root/lnmp0.9/php-5.2.17/ext/imap/
再执行
/usr/local/php/bin/phpize
安装成功后会返回如下信息:
configuring for: php api version: 20041225 zend module api no: 20060613 zend extension api no: 220060519
再执行以下命令:
./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap-ssl sudo make && make install
执行完返回:
build complete. don"t forget to run "make test". installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
表示已经成功,再修改/usr/local/php/etc/php.ini
最后面添加
extension = "imap.so"
最后重启lnmp,问题解决
/root/lnmp restart