错误:当我尝试在Centos 7上安装php 7版本,但软件包来自Php 5版本

nzkunb0c  于 2022-11-07  发布在  PHP
关注(0)|答案(1)|浏览(167)

当我尝试在我的centos 7上安装PHP 7版本时,但是该软件包来自PHP 5版本,所以我决定将repo rebel更改为Remi,并在收到以下错误

后禁用rebel

qybjjes1

qybjjes11#

我使用centos:7启动了一个Docker容器,并运行了以下命令:

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable   remi-php74
yum -y update
yum -y install php
yum -y install php-fpm php-gd php-json php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache

现在,让我们看看php版本。

sh-4.2# php -v
PHP 7.4.27 (cli) (built: Dec 14 2021 17:17:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies

sh-4.2# php-fpm -v
PHP 7.4.27 (fpm-fcgi) (built: Dec 14 2021 17:17:06)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies

相关问题