<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[CentOS 5.8 系统php5.2.17编译安装imap扩展]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[服务器类]]></category>
<pubDate>Thu, 20 Nov 2014 14:41:29 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	有个php程序需要使用php的imap扩展，而且当前环境默认又没有把imap编译进去，只好动手编译一个了，当前环境使用的是lnmp一键安装包，php的版本是php-5.2.17，安装目录为lnmp的默认安装目录/usr/local/php<br/><br/>一、下载php-5.2.17源码包<br/>wget -c http://www.zhanghaijun.com/soft/php/php-5.2.17.tar.gz<br/><br/>二、编译安装<br/>tar -xzvf php-5.2.17.tar.gz<br/>cd php-5.2.17/ext/imap/<br/>/usr/local/php/bin/phpize<br/>./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos=/usr --with-imap-ssl=/usr<br/>make && make install<br/><br/>可能遇到的报错有以下几个：<br/><br/>1、configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information<br/><br/>yum -y install libc-client&nbsp;&nbsp;libc-client-devel<br/><br/>2、configure: error: Cannot find imap library (libc-client.a). Please check your <br/><br/>ln -s /usr/lib64/libc-client.so&nbsp;&nbsp;/usr/lib/libc-client.so<br/><br/><br/>三、修改php.ini文件<br/>vi /usr/local/php/etc/php.ini<br/>在第49行extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" 的下面加一行<br/>extension="imap.so"<br/><br/>保存之后执行/usr/local/php/bin/php -m 就可以看见是否成功加载imap扩展了。<br/>[root@localhost php-5.2.17]# /usr/local/php/bin/php -m<br/>[PHP Modules]<br/>bcmath<br/>ctype<br/>curl<br/>date<br/>dom<br/>filter<br/>ftp<br/>gd<br/>gettext<br/>hash<br/>iconv<br/>imap<br/>json<br/>libxml<br/>mbstring<br/>mcrypt<br/>mhash<br/>mime_magic<br/>mysql<br/>mysqli<br/>openssl<br/>pcntl<br/>pcre<br/>PDO<br/>pdo_mysql<br/>pdo_sqlite<br/>posix<br/>Reflection<br/>session<br/>shmop<br/>SimpleXML<br/>soap<br/>sockets<br/>SPL<br/>SQLite<br/>standard<br/>sysvsem<br/>tokenizer<br/>xml<br/>xmlreader<br/>xmlrpc<br/>xmlwriter<br/>Zend Optimizer<br/>zip<br/>zlib<br/><br/>[Zend Modules]<br/>Zend Optimizer<br/><br/>最后重启下php-fpm就可以看见已经支持imap了。<br/>Tags - <a href="http://www.zhanghaijun.com/tags/php/" rel="tag">php</a> , <a href="http://www.zhanghaijun.com/tags/imap/" rel="tag">imap</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] CentOS 5.8 系统php5.2.17编译安装imap扩展]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>