skip to Main Content

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


  1. Using a proper configuration, from the wizard instructions, install should work

    # dnf install php-imap
    Dependencies resolved.
    ====================================================================================================================================================================================
     Package                     Arch                Version                     Repository                 Size
    ====================================================================================================================================================================================
    Installing:
     php-imap                    x86_64              7.2.34-4.el7.remi           remi-php72                       89 k
    Installing dependencies:
     libc-client                 x86_64              2007f-16.el7                epel                                      562 k
    
    Transaction Summary
    ====================================================================================================================================================================================
    Install  2 Packages
    
    Total download size: 651 k
    Installed size: 1.7 M
    Is this ok [y/N]: 
    
    • 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

    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.

    Login or Signup to reply.
  2. Depends on your centos/Rocky version: For me on Rocky 9 just now (installing php 8.0):

    dnf install epel-release
    dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
    

    Then remove any previous php install

    dnf remove php*
    dnf module reset php
    dnf module install php:remi-8.0
    
    dnf install php-imap
    

    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).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search