need help to install php 7.2 yum packages on aws ec2
Solution 1
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 ...
Solution 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
xeo
full stack developer and co-founder of xeodev agency in orlando a startup friendly disruptive tech agency
Updated on June 04, 2022Comments
-
xeo almost 2 years
I haven't seen any
yum
packages forphp
7.2 on AWS EC2 and the release has been out over a month.I have tried
yum list | grep php7
and only able seephp70
andphp71
packages.- Has anyone installed
php72
on AWS EC2? - Is there another
yum
repo to connect to? - Does AWS have a delivery scheduled?
- Has anyone installed
-
xeo about 6 yearsthank 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 about 6 yearsi 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
-
Jeff about 6 yearsTry
sudo yum install --disablerepo=* --enablerepo=remi,remi-php72 php php-fpm php-cli...
-
Typel over 5 yearsIf you're using Amazon Linux 2 AMI,
sudo amazon-linux-extras install -y php7.2
-
Yevgeniy Afanasyev over 5 yearsError: 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