almalinux 8 預設安裝的php 7.2
記錄一下升級到 php 8.2的步驟
看一下目前使用的版本及系統支援的版本
dnf module list php
Last metadata expiration check: 2:45:04 ago on Mon 04 Nov 2024 09:34:39 AM CST.
AlmaLinux 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
php 8.2 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
先reset 目前安裝的版本
dnf module reset php -y
再enable php 8.2
dnf module enable php:8.2 -y
接下來 dnf -y update 安裝所有 php8.2 相關套件
確認是否安裝完成
dnf module list php
AlmaLinux 8 - BaseOS 6.2 MB/s | 7.4 MB 00:01
AlmaLinux 8 - AppStream 5.7 MB/s | 14 MB 00:02
AlmaLinux 8 - Extras 18 kB/s | 13 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 8.3 MB/s | 14 MB 00:01
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
php 8.0 common [d], devel, minimal PHP scripting language
php 8.2 [e] common [d], devel, minimal PHP scripting language
提示:預設[d]、已啟用[e]、已停用[x]、已安裝[i]
檢查目前版本
php -v
重開几看看所有服務是否正常