Easy way to update PHP on Amazon Linux 2
Sep 10, 2020
PHP
AWS
EC2
Upgrade
Amazon Linux2
People who have installed PHP using Amazon Linux Extra of Amazon Linux 2 for the past year or so can update PHP quite easily just by disabling & enabling the package with Amazon Linux Extra. is.
Reference: How to update php on Amazon linux 2(Thanks!)
#My environment
- -AWS
- -Development server
- -Amazon Linux 2
- -Introduced Extra for PHP 7.1
- -List of installed PHP
libmcrypt php php-bcmath php-cli php-common php-dba php-embedded php-enchant php-fpm php-gd php-gmp php-intl php-json php-ldap php-mbstring php- mysqlnd php-odbc php-opcache php-pdo php-pecl-igbinary php-pecl-mcrypt php-pecl-zip php-pgsql php-process php-pspell php-recode php-soap php-xml php-xmlrpc
- -This Ansible is used to initially build the server. –Apache, MariaDB –I’m running concrete5 CMS.
- -Run as a user with sudo privileges such as
ec2-user
#Procedure
- Disable Amazon Extra PHP7.1:
$ sudo amazon-linux-extras disable php7.1
- Enable Amazon Extra PHP7.3:
$ sudo amazon-linux-extras enable php7.3
sudo yum update
――Actually, only PHP should be updated, but since it is development, I ran it all together. If it’s a production environment, should I just select PHP and run it to update? –Example:sudo yum update php *