CentOS Stream 8にphp8.0をインストールする

環境
# cat /etc/redhat-release
CentOS Stream release 8

インストールの方法
1.リポジトリを追加します
# sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

2.システムパッケージをアップデートします
# sudo dnf update

3.有効になっている PHP のバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# dnf module list php
Remi's Modular repository for Enterprise Linux 8 - x86_64
Name Stream Profiles Summary
php remi-7.2 common [d], devel, minimal PHP scripting language
php remi-7.3 common [d], devel, minimal PHP scripting language
php remi-7.4 common [d], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
# dnf module list php Remi's Modular repository for Enterprise Linux 8 - x86_64 Name Stream Profiles Summary php remi-7.2 common [d], devel, minimal PHP scripting language php remi-7.3 common [d], devel, minimal PHP scripting language php remi-7.4 common [d], devel, minimal PHP scripting language php remi-8.0 common [d], devel, minimal PHP scripting language php remi-8.1 common [d], devel, minimal PHP scripting language
#  dnf module list php
Remi's Modular repository for Enterprise Linux 8 - x86_64
Name         Stream             Profiles                               Summary
php          remi-7.2           common [d], devel, minimal             PHP scripting language
php          remi-7.3           common [d], devel, minimal             PHP scripting language
php          remi-7.4           common [d], devel, minimal             PHP scripting language
php          remi-8.0           common [d], devel, minimal             PHP scripting language
php          remi-8.1           common [d], devel, minimal             PHP scripting language

4. 他バージョンが有効な場合は一旦リセットします
# dnf module reset php

5.remi-8.0のアクティブ化を行います
# dnf module enable php:remi-8.0

6.PHP8.0をインストールします
# dnf install php php-cli php-common

7.phpバージョンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# php -v
PHP 8.0.14 (cli) (built: Dec 16 2021 03:01:07) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.14, Copyright (c) Zend Technologies
with Zend OPcache v8.0.14, Copyright (c), by Zend Technologies
# php -v PHP 8.0.14 (cli) (built: Dec 16 2021 03:01:07) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.14, Copyright (c) Zend Technologies with Zend OPcache v8.0.14, Copyright (c), by Zend Technologies
# php -v
PHP 8.0.14 (cli) (built: Dec 16 2021 03:01:07) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.14, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.14, Copyright (c), by Zend Technologies

 

CentOS Stream 8

Posted by arkgame