xeo
xeo

Reputation: 832

need help to install php 7.2 yum packages on aws ec2

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.

Upvotes: 9

Views: 13549

Answers (2)

bloke_zero
bloke_zero

Reputation: 508

As @Typel says in a comment on the other answer - if you're using Amazon Linux 2 AMI then

sudo amazon-linux-extras install -y php7.2

Beats installing multiple external repos and has most of th basics, including mariadb and vim (everything I need to feel happy!).

See the list: sudo amazon-linux-extras list

Upvotes: 6

Jeff
Jeff

Reputation: 6663

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

Upvotes: 6

Related Questions