找到之前安装的包,或是重新下载解压安装包: 1. 进入源码安装包 [root@hexu.org ~]$ cd /data/softs/php_packet/php-5.3.23/ext/imap 2. 安装imap依赖 [root@hexu.org imap]$ yum install -y libc-client-devel[root@hexu.org imap]$ ln -s /usr/lib64/libc
找到之前安装的包,或是重新下载解压安装包:
1. 进入源码安装包
[root@hexu.org ~]$ cd /data/softs/php_packet/php-5.3.23/ext/imap
2. 安装imap依赖
[root@hexu.org imap]$ yum install -y libc-client-devel[root@hexu.org imap]$ ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
3. 进行安装
[root@hexu.org imap]$ /usr/local/php/bin/phpize[root@hexu.org imap]$ ./configure --with-php-config=/usr/local/php/bin/php-config --with-imap --with-imap-ssl --with-kerberos[root@hexu.org imap]$ make && make install
4. 最后调整php.ini
[root@hexu.org imap]$ vi /usr/local/php/lib/php.ini##vi php.ini add following config[imap]extension = imap.so
5. 检查是否安装成功
[root@hexu.org imap]# php -vphp 5.3.23 (cli) (built: apr 7 2013 23:20:21) copyright (c) 1997-2013 the php groupzend engine v2.3.0, copyright (c) 1998-2013 zend technologies[root@hexu.org imap]# php -m | grep imapimap ## 看到这里,说明成功安装了
按上面顺序安装应该不会有报错,如果发现错误根据提示找相应的依赖包安装即可,下面举例安装过程遇到的2个error.
1. 没有安装libc-client-devel导致,按上面第一步安装即可, error info:
checking for utf8_mime2text signature... newchecking for u8t_decompose... configure: error: utf8_mime2text() has new signature, but u8t_canonical is missing. this should not happen. check config.log for additional information.
2. 找不到libc-client.a library, 需要手动添加文件link, errof info:
checking for crypt in -lcrypt... yesconfigure: error: cannot find imap library (libc-client.a). please check your c-client installation.
解决方法:
[root@hexu.org]$ ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
网友文章参考:http://blog.csdn.net/alexdream/article/details/7408453
原文地址:centos-6.3/php5.3.23 p 不重编译php添加 imap 扩展模块, 感谢原作者分享。
