AlmaLinux 8.4にphp8をインストールする
OSバージョンの確認
# cat /etc/redhat-release
AlmaLinux release 8.4 (Electric Cheetah)
1.リポジトリを追加
# sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm # sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm 略 インストール済み: remi-release-8.4-1.el8.remi.noarch
2.追加したリポジトリを確認
# dnf repolist
repo id repo の名前 appstream AlmaLinux 8 - AppStream baseos AlmaLinux 8 - BaseOS epel Extra Packages for Enterprise Linux 8 - x86_64 epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 extras AlmaLinux 8 - Extras remi-modular Remi's Modular repository for Enterprise Linux 8 - x86_64 remi-safe Safe Remi's RPM repository for Enterprise Linux 8 - x86_64
3.phpリポジトリを確認
# sudo dnf module enable php:remi-8.0 -y
# sudo dnf module list php
AlmaLinux 8 - AppStream Name Stream Profiles Summary php 7.2 [d] 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 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 [e] common [d], devel, minimal PHP scripting language php remi-8.1 common [d], devel, minimal PHP scripting language ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled
4.phpをインストール
# sudo dnf install php php-cli
# php -v
PHP 8.0.11 (cli) (built: Sep 21 2021 17:07:44) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.11, Copyright (c) Zend Technologies with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies