centos6和centos7手动扩展PHP的IMAP模块


一、centos6.7 x64上手动扩展PHP的IMAP模块

1、准备

yum install -y libc-client-devel

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

ln -s /usr/lib64/libkrb5.so /usr/lib/libkrb5.so

ln -s /usr/lib64/libssl.so /usr/lib/libssl.so


2、安装

cd/usr/local/PHP-5.5.35/ext/imap/

/usr/local/PHP/bin/PHPize

./configure -with-imap -with-PHP-config=/usr/local/PHP/bin/PHP-config --with-kerberos=/usr --with-imap-ssl=/usr

make

make install

wKioL1idiS3yepvJAAAtk1JeqcU196.png


3、添加模块

vim /usr/local/PHP/etc/PHP.ini //添加

extension = "imap.so"

重启PHP

/etc/init.d/PHP-fpm restart

再次查看PHP模块,可以发现已经有imap模块了

wKioL1idiZugDydwAAAUffveljU316.png

注意:./configure编译报错

报错1:configure: error:utf8_mime2text() has new signature,but U8T_CANONICAL is missing. This shouldnot happen. Check config.log for additional information

解决

yum install -y libc-client-devel

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

报错2:configure: error:Kerberos libraries not found. Check thepath given to --with-kerberos (if no path is given,searches in /usr/kerberos,/usr/local and /usr )

解决:ln -s /usr/lib64/libkrb5.so /usr/lib/libkrb5.so

报错3:configure: error:Cannot find OpenSSL's libraries

解决:ln -s /usr/lib64/libssl.so /usr/lib/libssl.so

重新./configure编译即可。




二、centos7.0.1406 x64上手动扩展PHP的IMAP模块

1、安装 PHP-imap

yum install -ypam-devel

cd /usr/local/src/

wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz

tar -zxvf imap-2007f.tar.gz

cd imap-2007f

make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd EXTRACFLAGS=-fPIC IP=4

mkdir /usr/local/imap-2007f/

mkdir /usr/local/imap-2007f/include/

mkdir /usr/local/imap-2007f/lib/

cp c-client/*.h /usr/local/imap-2007f/include/

cp c-client/*.c /usr/local/imap-2007f/lib/

cp c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a

2PHP手动加载PHP-imap

cd /usr/local/PHP-7.1.0/ext/imap/

./configure -with-imap=/usr/local/imap-2007f -with-PHP-config=/usr/local/PHP/bin/PHP-config --with-imap-ssl=/usr

make install

wKiom1idi3TgVd0WAAAwrA8s2A0680.png



注意:./configure编译报错

报错:configure: error:Cannot find OpenSSL's libraries

解决确认已安装过openssl、libssl-dev包,但是还是会提示错误

find / -name libssl.so //查找到路径为:/usr/lib64/libssl.so

ln -s /usr/lib64/libssl.so /usr/lib


重新编译即可



3添加PHP-imap模块

vim /usr/local/PHP/etc/PHP.ini //添加

extension ="imap.so"

重启PHP

再次查看PHP模块,可以发现已经有imap模块了

wKioL1idjDCCBXhJAAARaN3D70o455.png

相关文章

有时候CentOS工作在无互联网的环境下,需要在离线环境下安装一些组件,这次实现的是模拟在离线环境下安...
首先参照https://www.cnblogs.com/wdw984/p/13330074.html,来进行如何安装Centos和离线下载rpm包。 离...
有两个.NET CORE3.1网站部署在CentOS7上(内网IP是192.168.2.32),现在想实现访问http://192.168.2.32...
1、yum -y install vsftpd 安装vsftpd 2、配置vsftpd的配置文件(/etc/vsftpd/vsftpd.conf)主要修改以...
首先去mysql官网下载mysql的离线rpm安装包(https://downloads.mysql.com/archives/community/) Mysql...
第一步下载erlang环境并安装: wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_...