In 2013, I wrote about the process of installing the PHP extension IMAP in Junge's LNMP environment. At that time, it was LNMP1.0. Today, when I install it on a machine, it is slightly different. The VPS system is centos6.9 64bit. The environment It’s Jun Ge’s LNMP1.4, so I’ll update it.
1. Install the required libraries
[[email protected]]#yum install libc-client-devel
2. Enter the installation directory to decompress PHP
[[email protected]]#cd /root/lnmp1.4/src
[[email protected]]#tar -xjvf php-5.6.31 .tar.bz2
#Pay attention to the PHP version you installed, and decompress the response compressed package
3. Install IMAP
[[email protected] ]#cd /root/lnmp1.4/src/php-5.6.31/ext/imap
[[email protected]]#/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: < x2> 20131226
Zend Extension Api No: 220131226
[[email protected]]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap- ssl --with-libdir=lib64
[[email protected]]# make && make install
Build complete.
Don""t forget to run ""make test"".
Installing shared extensions: /usr/local/php/lib/php/ extensions/no-debug-non-zts-20131226/
4. Modify php.ini and restart
[[email protected]]#vi / usr/local/php/etc/php.ini
Find: extension_dir and add extension = "imap.so"
[[email protected]]#/etc /init.d/php-fpm restart
Finally, we check the component support through the probe: