Method: 1. Install dependency packages; 2. Execute phpize and configure under "ext/imap" of the php installation package; 3. Execute the "make && make install" command; 4. In php.ini Remove the semicolon before "extension=imap" and restart the service.
The operating environment of this tutorial: Centos 7 system, php7.4 version, DELL G3 computer
php 7.4 installation imap extension
Install dependency packages (Centos 7 environment)
yum install autoconf gcc gcc-c++ krb5-devel openssl-devel yum install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libc-client-2007f-16.el7.x86_64.rpm yum install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/u/uw-imap-devel-2007f-16.el7.x86_64.rpm
If the above method is very slow to download, you can download the corresponding file first,
and then enter the file location directory, execute the following command for offline installation
rpm -ivh *.rpm ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
Enter the ext/imap directory of the corresponding version of the php installation package, as follows
cd /usr/local/src/php-7.4.8/ext/imap
Execute phpize
/usr/local/php/bin/phpize
in the ext/imap directory Execute configure
./configure --with-php-config=/usr/local/php/bin/php-config --with-imap --with-imap-ssl --with-kerberos
Compile and install
make && make install
Edit the php.ini file, remove the semicolon in front of extension=imap, and restart the PHP service
Recommended learning: " PHP video tutorial》
The above is the detailed content of How to install imap extension in php. For more information, please follow other related articles on the PHP Chinese website!