malsony 发表于 2016-7-6 17:22:26

CentOS 7安装lnmp1.3后折腾php_imap记录

按照https://www.vpser.net/manage/lnmp-php-install-ext.html的教程,imap编译不成功,报错:configure: error: Cannot find imap library (libc-client.a). Please check your c-client install.找了下教程,先安装:libc-client-devel,但系统提示已安装。需要这样:ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap-ssl
make && make install才能编译成功。

但是第二次进行上面步骤的时候,系统报了另一个错误:configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.再次找资料,需要这样:wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz;
tar -zxf imap-2007f.tar.gz;
cd imap-2007f;
make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd EXTRACFLAGS=-fPIC IP=4;
mkdir /usr/local/src/imap-2007f/;
mkdir /usr/local/src/imap-2007f/include/;
mkdir /usr/local/src/imap-2007f/lib/;
cp c-client/*.h /usr/local/src/imap-2007f/include/;
cp c-client/*.c /usr/local/src/imap-2007f/lib/;
cp c-client/c-client.a /usr/local/src/imap-2007f/lib/libc-client.a;这时再回到~/lnmp1.3-full/src/php-7.0.7/ext/imap目录下/usr/local/php/bin/phpize;
./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap-ssl --with-imap=/usr/local/src/imap-2007f;
make && make install;终于编译成功了,再在php.ini上加入extension="imap.so",保存后lnmp restart,搞定。

[ 本帖最后由 malsony 于 2016-7-12 00:32 编辑 ]
页: [1]
查看完整版本: CentOS 7安装lnmp1.3后折腾php_imap记录