I am trying to install imap extension on a CentOS 7 server with PHP version 7.2.23. I tried the command yum install php-imap
and output is
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 21 kB 00:00:00
* base: mirrors.vangus.co.il
* epel: mirror.de.leaseweb.net
* extras: mirror.ratiokontakt.de
* remi-php72: mirror.23media.com
* remi-safe: mirror.23media.com
* updates: mirror.fra10.de.leaseweb.net
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
mariadb | 3.4 kB 00:00:00
remi-php72 | 3.0 kB 00:00:00
remi-safe | 3.0 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(2/2): epel/x86_64/primary_db | 6.9 MB 00:00:00
No package php-imap available.
Error: Nothing to do
So I googled and found out that we can install from epel repository. So I ran the command yum list *imap*
and I am getting
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.vangus.co.il
* epel: mirror.de.leaseweb.net
* extras: mirror.ratiokontakt.de
* remi-php72: mirror.23media.com
* remi-safe: mirror.23media.com
* updates: mirror.fra10.de.leaseweb.net
Available Packages
cyrus-imapd.x86_64 2.4.17-15.el7 base
cyrus-imapd-devel.i686 2.4.17-15.el7 base
cyrus-imapd-devel.x86_64 2.4.17-15.el7 base
cyrus-imapd-utils.x86_64 2.4.17-15.el7 base
imapfilter.x86_64 2.6.15-1.el7 epel
imapsync.noarch 1.727-1.el7 epel
imaptest.x86_64 20151005-1.el7 epel
offlineimap.noarch 6.7.0-1.el7 epel
perl-Mail-IMAPClient.noarch 3.37-1.el7 epel
python-abimap-doc.noarch 0.3.1-3.el7 epel
python36-abimap.noarch 0.3.1-3.el7 epel
up-imapproxy.x86_64 1.2.8-0.12.20171022svn14722.el7 epel
uw-imap.x86_64 2007f-16.el7 epel
uw-imap-devel.x86_64 2007f-16.el7 epel
uw-imap-static.x86_64 2007f-16.el7 epel
uw-imap-utils.x86_64 2007f-16.el7 epel
How can I install imap extension for PHP? Please help.
2
Answers
Using a proper configuration, from the wizard instructions, install should work
Hmm… looks good
Package php-imap exists and should be found
Please check yum enabled plugins, or try with –noplugins options
Please also be aware that PHP 7.2 has reached its end of life in November 2020, so you should consider using a supported version.
Depends on your centos/Rocky version: For me on Rocky 9 just now (installing php 8.0):
Then remove any previous php install
Gives you access to more modules than just imap; obviously add the others as needed. Change the rpm URL based on your Distro version E.g. Centos/Rocky 8, Rocky 9 etc.. Change the php:remi command based on which php version you want (e.g. 8.0 in the example above).