php packet,不重编译PHP添加 IMAP 扩展模块

本文介绍了在CentOS6.5中因yum安装软件提示404错误,而需要修改yum源为163源的步骤,并详细讲解了如何不重编译PHP来添加IMAP扩展模块。首先切换到/etc/yum.repos.d目录,备份并替换CentOS-Base.repo为163源,然后清理缓存。接着在已安装的PHP源码包中安装IMAP依赖,进行配置和编译,最后在php.ini中添加imap.so扩展并验证安装成功。
摘要由CSDN通过智能技术生成

[CentOS6.5中修改yum源]http://www.cnblogs.com/liuling/p/2014-4-14-001.html

在自己安装的CentOS6.5中使用yum安装软件,总是提示404错误信息,百度后发现原来要设置yum源。

在安装完CentOS后一般需要修改yum源,才能够在安装更新rpm包时获得比较理想的速度。国内比较快的有163源、sohu源。这里以163源为例子。

1. cd /etc/yum.repos.d

2. mv CentOS-Base.repo CentOS-Base.repo.backup

3. wget

4. mv CentOS6-Base-163.repo CentOS-Base.repo

5.yum clean all

[Centos-6.3/PHP5.3.23 P 不重编译PHP添加 IMAP 扩展模块]http://blog.hexu.org/archives/1822.shtml

找到之前安装的包,或是重新下载解压安装包:

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 -v

PHP 5.3.23 (cli) (built: Apr  7 2013 23:20:21)

Copyright (c) 1997-2013 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

[root@hexu.org imap]# php -m | grep imap

imap ## 看到这里,说明成功安装了

按上面顺序安装应该不会有报错,如果发现错误根据提示找相应的依赖包安装即可,下面举例安装过程遇到的2个error.

1. 没有安装libc-client-devel导致,按上面第一步安装即可, Error info:

checking for utf8_mime2text signature... new

checking 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... yes

configure: 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

阅读(3065) | 评论(0) | 转发(0) |

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值