提问者:小点点

PHP安装:错误:无法切换模块的已启用流


我试图升级php从7.2到最后7.4版本在centos 8与以下命令:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm

dnf module list php

但是当我启动这个命令时:dnf模块启用php: remi-7.4-y

我收到这个错误:

Last metadata expiration check: 0:05:44 ago on Fri 24 Jul 2020 08:56:07 PM CEST.
Dependencies resolved.
The operation would result in switching of module 'php' stream '7.2' to stream 'remi-7.4'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can install the other stream.

我怎样才能解决这个问题?


共1个答案

匿名用户

正如向导说明所解释的,以及粘贴的错误消息所解释的,在启用新版本流之前,您需要禁用旧版本流:

dnf module reset php
dnf module install php:remi-7.4
dnf update