4

I'm running a dedicated server with CentOS 7 64bit, here is the output when trying to install IMAP:

yum install php-imap  
Loaded plugins: fastestmirror  
Loading mirror speeds from cached hostfile  
 * base: ftp.ciril.fr  
 * extras: ftp.ciril.fr  
 * updates: ftp.ciril.fr  
No package php-imap available.  
Error: Nothing to do    

Also the same when disabling exclusions:

sudo yum install --disableexcludes=all php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.ciril.fr
 * extras: ftp.ciril.fr
 * updates: ftp.ciril.fr
No package php-imap available.
Error: Nothing to do
1
  • I typically run sudo yum list *imap* to see what there is to install. This yielded 'php56-php-imap.x86_64' this time, but is helpful for all kinds of installs, to see if I need to add a repo or just get the name right.
    – Ryan
    Jun 19 '15 at 21:35
6

Just run the following commands

yum install epel-release*

yum install php-imap*

3
  • 1
    This needs explanation. And you also need quoting in those commands.
    – kasperd
    Dec 17 '15 at 11:05
  • There's nothing wrong with this answer. It's pretty self-explaining. You must install EPEL repository, then you will be able to get php-imap package. It's working here like a charm. Jan 24 '17 at 18:31
  • The yum -y install epel-release command worked perfectly for me. (CentOS 7) May 14 '18 at 18:22
3

It's in the epel repo. See http://pkgs.org for a search function for such things.

0
0

here was what I did to install PHP7.0 IMAP Extension on Centos 7.1

I downloaded setup-ius.sh from here: https://gist.github.com/SunDi3yansyah/3edc2370268c335362c896cd2d1094ad

Then, install it using command:

yum install php70u-imap

And it worked! Good luck!

1
  • 1
    This also requires switching PHP to the IUS builds, which many people will be unwilling to do. Dec 8 '18 at 14:02
0

For Amazon Linux 2 (AL2), I've struggled to install imap extension on PHP 8.0 but I was able to this way:

yum update -y
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y php80-php-imap

cp /opt/remi/php80/root/usr/lib64/php/modules/imap.so /usr/lib64/php/modules/
/bin/echo 'extension="imap.so"' > /etc/php.d/40-imap.ini

systemctl restart php-fpm

The trick is to use Remi repository as they have compiled imap extension. I'm guessing that further on, the standard

2
  • This is not the proper way, see the wizard instructions rpms.remirepo.net/wizard May 16 at 6:17
  • It looks like you need php-imap (from remi-php80, not php80-php-imap which is designed for parallel installation, a SCL) May 16 at 6:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.