need help to install php 7.2 yum packages on aws ec2

xeo picture xeo · Dec 30, 2017 · Viewed 11.2k times · Source

I haven't seen any yum packages for php 7.2 on AWS EC2 and the release has been out over a month.

I have tried yum list | grep php7 and only able see php70 and php71 packages.

  • Has anyone installed php72 on AWS EC2?
  • Is there another yum repo to connect to?
  • Does AWS have a delivery scheduled?

Answer

Jeff picture Jeff · Jan 31, 2018

Although the @amzn-main repo doesn't have PHP 7.2 yet (as far as I know), you can use remi-php72. According to his release blog you can install the EPEL and Remi repositories via:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm
rpm -Uvh epel-release-latest-6.noarch.rpm

And then enable remi-php72 using yum-config-manager:

yum install yum-utils
yum-config-manager --enable remi-php72

After that, you can simply search and install php and all the needed extensions like normal:

sudo yum install --disablerepo="*" --enablerepo="remi,remi-php72" php php-fpm php-cli ...