How to upgrade to PHP8.0 on Amazon Linux 2 EC2 instance?

0

Hi, I have upgraded the software I am hositng on EC2 instance but to funciton it requires PHP 8.0. I was not able to upgrade the PHP using the yup update and other Amazon tools I found on the forums. PHP version is stuck at 7.x and I really need to update to 8.0 on an urgent basis. Can you pleaes help?

已提问 9 个月前6172 查看次数
3 回答
0

Have you tried

take a snapshot of your instance, Take a copy of php.ini, List the modules that you installed with php, yum remove -y php and its modules (php -m will give the modules list), amazon-linux-extras disable php7version, amazon-linux-extras enable php8version, yum install php and its modules.

已回答 9 个月前
0

Have you tried changing the version of PHP using the following command

sudo update-alternatives --config php
profile picture
专家
已回答 9 个月前
0

You can install PHP 8.0, 8.1, 8.2 from amazon-linux-extras

amazon-linux-extras | grep php

May need to remove existing php7 packages first, before you enable 8.x package

sudo yum remove php*
sudo yum clean all
sudo amazon-linux-extras enable php8.0
sudo yum clean metadata
sudo yum install -q -y php-cli php-fpm php-opcache php-common
AWS
专家
Mike_L
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则