言語関連 目次

概要

PHPの環境管理全般

バージョン管理

CentOS8でPHP7.3を使う

環境情報

OSCentOS Stream release 8

手順

  • 1. 現在のPHPバージョンを確認
    # dnf module list php
    • 術力結果
      Repository google-chrome is listed more than once in the configuration
      Last metadata expiration check: 2:15:45 ago on Mon 14 Nov 2022 02:28:03 PM UTC.
      CentOS Stream 8 - AppStream
      Name                   Stream                      Profiles                                    Summary                                
      php                    7.2 [d][e]                  common [d], devel, minimal                  PHP scripting language                 
      php                    7.3                         common [d], devel, minimal                  PHP scripting language                 
      php                    7.4                         common [d], devel, minimal                  PHP scripting language                 
      php                    8.0                         common [d], devel, minimal                  PHP scripting language                 
      
      Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
  • 2. バージョン指定をリセット
    # dnf module reset php
    • 出力結果
      Repository google-chrome is listed more than once in the configuration
      Last metadata expiration check: 2:15:59 ago on Mon 14 Nov 2022 02:28:03 PM UTC.
      Dependencies resolved.
      ======================================================================================================================================
       Package                         Architecture                   Version                         Repository                       Size
      ======================================================================================================================================
       Resetting modules:
       php                                                                                                                                 
      
      Transaction Summary
      ======================================================================================================================================
      
      Is this ok [y/N]: y
      Complete!
  • 3. バージョンを7.3に変更
    # dnf module enable php:7.3
    • 出力結果
      Repository google-chrome is listed more than once in the configuration
      Last metadata expiration check: 2:16:09 ago on Mon 14 Nov 2022 02:28:03 PM UTC.
      Dependencies resolved.
      ======================================================================================================================================
       Package                         Architecture                   Version                         Repository                       Size
      ======================================================================================================================================
      Enabling module streams:
       php                                                            7.3                                                                  
      
      Transaction Summary
      ======================================================================================================================================
      
      Is this ok [y/N]: y
      Complete!
  • 4. PHPをバージョンアップ
    # dnf module -y update php:7.3
    • 出力結果
      Repository google-chrome is listed more than once in the configuration
      Last metadata expiration check: 2:16:21 ago on Mon 14 Nov 2022 02:28:03 PM UTC.
      Dependencies resolved.
      ======================================================================================================================================
       Package                     Architecture          Version                                             Repository                Size
      ======================================================================================================================================
      Upgrading: 
       libzip                      x86_64                1.5.2-1.module_el8.2.0+314+53b99e08                 appstream                 63 k
       php                         x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                1.5 M
       php-bcmath                  x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                 79 k
       php-cli                     x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                3.0 M 
       php-common                  x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                669 k
       php-fpm                     x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                1.6 M
       php-gd                      x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                 84 k
       php-intl                    x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                192 k
       php-json                    x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                 73 k
       php-ldap                    x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                 84 k
       php-mbstring                x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                618 k
       php-mysqlnd                 x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                189 k
       php-pdo                     x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                122 k
       php-pecl-zip                x86_64                1.15.4-1.module_el8.2.0+314+53b99e08                appstream                 50 k
       php-xml                     x86_64                7.3.20-1.module_el8.2.0+498+4deef2f1                appstream                187 k 
      
      Transaction Summary
      ======================================================================================================================================
      Upgrade  15 Packages
      (以下略)
  • 5. バージョンを確認
    # php -v
    • 出力結果
      PHP 7.3.20 (cli) (built: Jul  7 2020 07:53:49) ( NTS )
      Copyright (c) 1997-2018 The PHP Group
      Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-11-15 (火) 01:58:18 (529d)