A "recommended improvement" has appeared in the site health of the WordPress administrator screen, asking you to raise the php version to 7.3 or higher.
Upgrade php. I don't know what it is, so keep it up to date.
$ php -v
PHP 7.2.30 (cli) (built: May 5 2020 18:04:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
As angry with WordPress. old.
In the usual way. I used a mac terminal. Reference: Connecting to your Linux instance using SSH
Use which command to verify that the amazon-linux-extras package is installed.
$ which amazon-linux-extras
/usr/bin/amazon-linux-extras
If the amazon-linux-extras package is not installed, use yum to install it.
$ sudo yum install -y amazon-linux-extras
$ amazon-linux-extras
#abridgement
13 ruby2.4 available \
[ =2.4.2 =2.4.4 =2.4.7 =stable ]
_ php7.2 available \
[ =7.2.0 =7.2.4 =7.2.5 =7.2.8 =7.2.11 =7.2.13 =7.2.14
=7.2.16 =7.2.17 =7.2.19 =7.2.21 =7.2.22 =7.2.23
=7.2.24 =7.2.26 =stable ]
_ lamp-mariadb10.2-php7.2 available \
[ =10.2.10_7.2.0 =10.2.10_7.2.4 =10.2.10_7.2.5
=10.2.10_7.2.8 =10.2.10_7.2.11 =10.2.10_7.2.13
=10.2.10_7.2.14 =10.2.10_7.2.16 =10.2.10_7.2.17
=10.2.10_7.2.19 =10.2.10_7.2.22 =10.2.10_7.2.23
=10.2.10_7.2.24 =stable ]
#abridgement
30 squid4 available [ =4 =stable ]
_ php7.3 available \
[ =7.3.2 =7.3.3 =7.3.4 =7.3.6 =7.3.8 =7.3.9 =7.3.10
=7.3.11 =7.3.13 =stable ]
#abridgement
42 php7.4 available [ =stable ]
#abridgement
Since it is displayed in a row, I omitted a part. At this point php7.4 seems to be the latest php available for amazon-linux-extras.
First, stop the old php7.2.
$ sudo amazon-linux-extras disable php7.2
Enable php7.4.
$ sudo amazon-linux-extras enable php7.4
#abridgement
13 ruby2.4 available \
[ =2.4.2 =2.4.4 =2.4.7 =stable ]
_ php7.2 available \
[ =7.2.0 =7.2.4 =7.2.5 =7.2.8 =7.2.11 =7.2.13 =7.2.14
=7.2.16 =7.2.17 =7.2.19 =7.2.21 =7.2.22 =7.2.23
=7.2.24 =7.2.26 =stable ]
_ lamp-mariadb10.2-php7.2 available \
[ =10.2.10_7.2.0 =10.2.10_7.2.4 =10.2.10_7.2.5
=10.2.10_7.2.8 =10.2.10_7.2.11 =10.2.10_7.2.13
=10.2.10_7.2.14 =10.2.10_7.2.16 =10.2.10_7.2.17
=10.2.10_7.2.19 =10.2.10_7.2.22 =10.2.10_7.2.23
=10.2.10_7.2.24 =stable ]
#abridgement
30 squid4 available [ =4 =stable ]
_ php7.3 available \
[ =7.3.2 =7.3.3 =7.3.4 =7.3.6 =7.3.8 =7.3.9 =7.3.10
=7.3.11 =7.3.13 =stable ]
#abridgement
42 php7.4=latest enabled [ =stable ]
#abridgement
Now you can install:
# yum clean metadata
# yum install php-cli php-pdo php-fpm php-json php-mysqlnd
Sudo the bottom two lines of "Now you can install:" above. You can do it line by line, but connect it with && and execute it.
$ sudo yum clean metadata && yum install php-cli php-pdo php-fpm php-json php-mysqlnd
$ yum list installed php-cli php-pdo php-fpm php-json php-mysqlnd
Loaded plugin:extras_suggestions, langpacks, priorities, update-motd
Installed packages
php-cli.x86_64 7.4.5-1.amzn2 @amzn2extra-php7.4
php-fpm.x86_64 7.4.5-1.amzn2 @amzn2extra-php7.4
php-json.x86_64 7.4.5-1.amzn2 @amzn2extra-php7.4
php-mysqlnd.x86_64 7.4.5-1.amzn2 @amzn2extra-php7.4
php-pdo.x86_64 7.4.5-1.amzn2 @amzn2extra-php7.4
$ php -v
PHP 7.4.5 (cli) (built: Apr 23 2020 00:10:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
You did it! Finally restart httpd.service.
$ sudo systemctl restart httpd.service
If you check the site health of the WordPress administration screen,
The site is running the current version of PHP (7.4.5)
Now it's done!
--Official AWS Q & A: https://aws.amazon.com/jp/premiumsupport/knowledge-center/ec2-install-extras-library-software/
Recommended Posts