1

I'm trying to install php 8.1 on a Graviton 2 (ARM64) EC2 instance thats running Amazon Linux 2.

All of the guides I've followed use remi-release-7.rpm. When I use this repository, yum updates are flooded with 404 errors like

http://rpms.remirepo.net/enterprise/7/safe/aarch64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

Is there a relatively easy way to install PHP 8.1 on this type of instance?

Hunter
  • 241
  • 2
  • 11

2 Answers2

2

You can build it from source. I was able to install it on Amazon Linux 2 on Graviton (aarch64, 5.10 kernel) using the steps below. Be sure to update the url in the wget command to the latest available version or what ever you want to build.

sudo yum -y groupinstall "Development Tools" "Development Libraries"
sudo yum -y install libxml2-devel sqlite-devel
wget https://www.php.net/distributions/php-8.1.5.tar.xz
tar -xf php-8.1.5.tar.xz
cd php-8.1.5/
./configure
make -j$(nproc)
sudo make -j$(nproc) install

Alternatively, you could just use a container. You can get one from Amazon ECR here: https://gallery.ecr.aws/docker/library/php

docker pull public.ecr.aws/docker/library/php:8.1-rc-apache-bullseye
Jonathan Swinney
  • 1,054
  • 9
  • 29
1

Amazon Linux 2 now has built-in support for PHP 8.1 including ARM!

https://repost.aws/questions/QUsfhDbww4SAy8i5Jmd4vcMg/amazon-linux-2-amazon-linux-extras-php-8-1-support

Juha Vehnia
  • 1,255
  • 12
  • 15