Friday, March 29, 2024

CentOS 8系統PHP 7.2更新到PHP 7.4

WordPress推薦將目前正在使用的PHP 7.2更新至PHP 7.4。查了一下資料,Remi’s RPM repository提供了一個嚮導,步驟簡單清晰。

訪問https://rpms.remirepo.net/wizard/,選擇系統為CentOS 8 ,PHP版本為7.4.33,安裝類型為Default/Single (simplest way)。接下來按嚮導操作即可。

操作步驟如下:

dnf config-manager --set-enabled powertools
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module reset php
dnf module install php:remi-7.4
dnf update

注意事項:
1、建議重新啟動PHP,否則網站可能不能正常運行。
2、查看當前的PHP版本。

php --version
php --modules

One comment

  1. centos準備停更了,哎,vps還在用centos,到時候再和php一起換新版本吧

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.