LoginSignup
6
6

More than 3 years have passed since last update.

Amazon Linux でのPHPバージョンアップ

Posted at

PHP7.2 から PHP7.4 にあげる

業務で使うことがあったので備忘録。

0.開発環境

  • Amazon Linux 2
  • PHP 7.23
  • Apache/2.4.46

1. 旧バージョンのPHPと関連モジュールを削除

sudo yum -y remove php-*

2.php7.2を廃止

sudo amazon-linux-extras disable php7.2

3.php7.4を適用

sudo amazon-linux-extras enable php7.4

4.phpと関連モジュールの再インストール

sudo yum install  php php-devel php-mbstring php-pdo php-gd php-mysqlnd php-cli php-common php-xml php-fpm php-json

5.バージョン確認

$ php -v
// 7.4になっていれば成功
PHP 7.4.11 (cli) (built: Oct 21 2020 19:12:26) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

6.apache再起動

sudo systemctl restart httpd.service

以上

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6