[Amazon linux 2]amazon-linux-extrasを使ったPHPバージョンアップ

LINEで送る
Pocket

  • 確認
# yum list installed |grep php
jemalloc.x86_64                       3.6.0-1.amzn2.0.1              @amzn2extra-lamp-mariadb10.2-php7.2
mariadb.x86_64                        3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-backup.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-common.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-config.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
                                      3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-errmsg.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-gssapi-server.x86_64          3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-libs.x86_64                   3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-rocksdb-engine.x86_64         3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-server.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-server-utils.x86_64           3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-tokudb-engine.x86_64          3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
php-cli.x86_64                        7.2.31-1.amzn2                 @amzn2extra-php7.2
php-common.x86_64                     7.2.31-1.amzn2                 @amzn2extra-php7.2
php-fpm.x86_64                        7.2.31-1.amzn2                 @amzn2extra-php7.2
php-json.x86_64                       7.2.31-1.amzn2                 @amzn2extra-php7.2
php-mbstring.x86_64                   7.2.31-1.amzn2                 @amzn2extra-php7.2
php-mysqlnd.x86_64                    7.2.31-1.amzn2                 @amzn2extra-php7.2
php-opcache.x86_64                    7.2.31-1.amzn2                 @amzn2extra-php7.2
php-pdo.x86_64                        7.2.31-1.amzn2                 @amzn2extra-php7.2
php-pecl-apcu.x86_64                  5.1.12-3.amzn2.0.1             @amzn2extra-lamp-mariadb10.2-php7.2

# amazon-linux-extras |grep php
 15  php7.2=latest                   enabled      \
 17  lamp-mariadb10.2-php7.2=latest  enabled      \
  _  php7.3                          available    \
  _  php7.4                          available    [ =stable ]
  • 現状のバージョンを無効化する
# amazon-linux-extras disable lamp-mariadb10.2-php7.2
# amazon-linux-extras disable php7.2
  • php7.4に有効化とインストール
# amazon-linux-extras enable php7.4

# yum clean metadata && yum install php-cli php-pdo php-fpm php-json php-mysqlnd
  • 確認とapache再起動
# php -v
PHP 7.4.7 (cli) (built: Jul  2 2020 23:17:59) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.7, Copyright (c), by Zend Technologies

# yum list installed |grep php
jemalloc.x86_64                       3.6.0-1.amzn2.0.1              @amzn2extra-lamp-mariadb10.2-php7.2
mariadb.x86_64                        3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-backup.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-common.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-config.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
                                      3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-errmsg.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-gssapi-server.x86_64          3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-libs.x86_64                   3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-rocksdb-engine.x86_64         3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-server.x86_64                 3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-server-utils.x86_64           3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
mariadb-tokudb-engine.x86_64          3:10.2.10-2.amzn2.0.3          @amzn2extra-lamp-mariadb10.2-php7.2
php-cli.x86_64                        7.4.7-1.amzn2                  @amzn2extra-php7.4
php-common.x86_64                     7.4.7-1.amzn2                  @amzn2extra-php7.4
php-fpm.x86_64                        7.4.7-1.amzn2                  @amzn2extra-php7.4
php-json.x86_64                       7.4.7-1.amzn2                  @amzn2extra-php7.4
php-mbstring.x86_64                   7.4.7-1.amzn2                  @amzn2extra-php7.4
php-mysqlnd.x86_64                    7.4.7-1.amzn2                  @amzn2extra-php7.4
php-opcache.x86_64                    7.4.7-1.amzn2                  @amzn2extra-php7.4
php-pdo.x86_64                        7.4.7-1.amzn2                  @amzn2extra-php7.4
php-pecl-apcu.x86_64                  5.1.18-1.amzn2                 @amzn2extra-php7.4

# systemctl restart httpd.service

 

Was this helpful?

0 / 0

コメントを残す 0

Your email address will not be published. Required fields are marked *