Home > Backend Development > PHP Problem > How to install and configure php imap

How to install and configure php imap

藏色散人
Release: 2023-03-11 07:32:02
Original
3194 people have browsed it

How to install and configure php imap: 1. Install the required dependencies; 2. Download the php7.4 source code package; 3. Compile the extension module; 4. Modify php.ini to add the imap extension.

How to install and configure php imap

The operating environment of this article: Centos7 system, PHP7.4 version, DELL G3 computer

How to install and configure php imap?

php7 install imap extension

Currently using Centos7.x system, php uses version 7.4, wlnmp one-click package already supports this extension

imap extension is included in php In the source code package

1. Install the required dependencies. If you are prompted that other dependencies are missing during compilation, please install them yourself

yum install autoconf gcc gcc-c++ libc-client-devel krb5-devel openssl-devel
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
Copy after login
Copy after login
yum install autoconf gcc gcc-c++ libc-client-devel krb5-devel openssl-devel
ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
Copy after login
Copy after login

2. Download the php7.4 source code package

wget https://www.php.net/distributions/php-7.4.5.tar.gz
tar xf php-7.4.5.tar.gz
cd php-7.4.5/ext/imap
/usr/local/php/bin/phpize
Copy after login
Copy after login
wget https://www.php.net/distributions/php-7.4.5.tar.gz
tar xf php-7.4.5.tar.gz
cd php-7.4.5/ext/imap
/usr/local/php/bin/phpize
Copy after login
Copy after login

Just run it according to the location of your own phpize (if you don’t know where phpize is, just find / -name phpize to search). After running, the following information will be prompted, and then compile

Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Copy after login

3. Compile the extension module

./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap-ssl
make
make install
Copy after login
Copy after login
./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap-ssl
make
make install
Copy after login
Copy after login

After the execution is completed, the directory where the extension module is compiled will be displayed /usr/local/php/lib/php/extensions/no-debug-non-zts-20190902/

4. Modify php.ini and add Extension

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20190902/"
extension=imap.so
Copy after login
Copy after login
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20190902/"
extension=imap.so
Copy after login
Copy after login

Note: If the extension_dir path has been configured before, you only need to configure extension=imap.so

Save and exit, restart php

Pass php -m | grep imap command can see that the extension has taken effect

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to install and configure php imap. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template