php-mcrypt package missing from yum on AWS AMI
I was able to install php-mcrypt
following the suggestion on this page using EPEL for EL 7 into AWS release 2.0 (2017.12) Linux.
This is an Amazon instance running Amazon Linux 2 (2017.12) which I tested with...
# cat /etc/system-release
Amazon Linux release 2.0 (2017.12) LTS Release Candidate
# curl http://169.254.169.254/latest/meta-data/ami-id
ami-428aa838
The people at amazon claim that AWS distro is not based specifically on any version of RedHat, so there is no guarantee of compatibility, but comparing the versions of the PHP packages in EPEL for Enterprise linux 7, and the amazon ones, suggests they are building from the same source;
for example the build numbers are exactly the same Version : 5.4.16
on the packages from amzn2-core
and epel
Name : php-mcrypt
Version : 5.4.16
Release : 7.el7
From repo : epel
vs
Name : php
Version : 5.4.16
Release : 43.amzn2.0.1
From repo : amzn2-core
So I am not surprised the package from epel installed on the 2017.12 AWS AMI no problem...
# yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
...
Installing : epel-release-7-11.noarch 1/1
Verifying : epel-release-7-11.noarch 1/1
Installed:
epel-release.noarch 0:7-11
Complete!
and then installed php-mcrypt
;
# yum install -y --enablerepo=epel php-mcrypt
Running transaction test
Transaction test succeeded
Running transaction
Installing : libmcrypt-2.5.8-13.el7.x86_64 1/2
Installing : php-mcrypt-5.4.16-7.el7.x86_64 2/2
Verifying : libmcrypt-2.5.8-13.el7.x86_64 1/2
Verifying : php-mcrypt-5.4.16-7.el7.x86_64 2/2
Installed:
php-mcrypt.x86_64 0:5.4.16-7.el7
Dependency Installed:
libmcrypt.x86_64 0:2.5.8-13.el7
Complete!
and then you can test to see that mcrypt extensions is installed like so;
# php -i "(command-line 'phpinfo()')" | grep mcrypt
/etc/php.d/mcrypt.ini,
Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
I also disabled epel, as I don't want to end up with a mix of packages from both repos beyond the minimum;
yum-config-manager --disablerepo=epel
# yum repolist all
Loaded plugins: langpacks, priorities, update-motd
repo id repo name status
amzn2-core/2017.12/x86_64 Amazon Linux 2 core enabled: 7,157
epel/x86_64 Extra Packages disabled