8

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?
galoget
  • 529
  • 6
  • 11
xeo
  • 797
  • 2
  • 5
  • 24

2 Answers2

6

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 ... 
Jeff
  • 6,693
  • 2
  • 19
  • 34
  • thank you! it didn't initially work until i split the rpm line into two individual ones. so i editted your answer with that change. – xeo Jan 31 '18 at 20:25
  • 1
    i tried several ways to get this to work. on aws the aws repo takes over for the standard yum install php and i was successfully using yum install php71 but now when i try to yum install php72 i get errors because scl-utils is not installed and this recipe doesn't install or enable scl. i think you're close, but if you can get it running on aws and edit the recipe it would help a lot. thx – xeo Jan 31 '18 at 20:54
  • 1
    Try ```sudo yum install --disablerepo=* --enablerepo=remi,remi-php72 php php-fpm php-cli...``` – Jeff Feb 02 '18 at 04:17
  • 3
    If you're using Amazon Linux 2 AMI, `sudo amazon-linux-extras install -y php7.2` – Typel Sep 20 '18 at 21:06
  • 1
    Error: Package: php72-runtime-1.0-1.el6.remi.x86_64 (remi) Requires: scl-utils Error: Package: environment-modules-3.2.10-0.el6.remi.x86_64 (remi) Requires: libtcl8.5.so()(64bit) Error: Package: php72-runtime-1.0-1.el6.remi.x86_64 (remi) Requires: /usr/sbin/semanage – Yevgeniy Afanasyev Oct 17 '18 at 00:21
2

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

bloke_zero
  • 438
  • 6
  • 12