centos8.2安装php7.4

1.添加并更新epel源

dnf -y install epel-release
dnf update epel-release

报错
Repository epel is listed more than once in the configuration
Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                                                              381 kB/s | 1.0 MB     00:02    
Last metadata expiration check: 0:00:01 ago on Wed 25 May 2022 05:57:47 PM CST.
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Dependencies resolved.

执行 
sudo dnf upgrade libmodulemd

2.删除缓存的无用软件包并更新软件源

dnf clean all
dnf makecache

3.

dnf module enable php:7.4

4. 安装(无需remi ,原因 centos - centos8 - error installing php74 - Server Fault)

dnf install php php-curl php-dom php-exif php-fileinfo php-fpm php-gd php-hash php-json php-mbstring php-mysqli php-openssl php-pcre php-xml libsodium

猜你喜欢

转载自blog.csdn.net/skylovesky/article/details/124971824