Home >Backend Development >PHP Problem >How to install imap extension in php

How to install imap extension in php

青灯夜游
青灯夜游Original
2021-03-08 12:00:004529browse

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.

How to install imap extension in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn