无论我跟随什么教程,最终都会出现这个错误。这里有一个示例教程。
[jalal@goku ~]$ sudo yum install epel-release yum-utils
Package epel-release-7-11.noarch already installed and latest version
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
[jalal@goku ~]$ sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Error: Nothing to do
系统规格如下:
$ uname -a
Linux goku.bu.edu 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
我该如何在CentOS 7上安装php 7.x呢?
如果我忽略这个问题并按照以下命令操作(即使我已经删除了php5.x),它仍然会安装php 5.x:
$ sudo yum-config-manager --enable remi-php73
[sudo] password for jalal:
=============================== repo: remi-php73 ===============================
[remi-php73]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7
baseurl =
cache = 0
cachedir = /var/cache/yum/x86_64/7/remi-php73
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = 1
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7/remi-php73/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7/remi-php73/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
hdrdir = /var/cache/yum/x86_64/7/remi-php73/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist = http://cdn.remirepo.net/enterprise/7/php73/mirror
mirrorlist_expire = 86400
name = Remi's PHP 7.3 RPM repository for Enterprise Linux 7 - x86_64
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7/remi-php73
pkgdir = /var/cache/yum/x86_64/7/remi-php73/packages
priority = 99
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = remi-php73
ui_repoid_vars = releasever,
basearch
username =
$ sudo yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
Package php-mcrypt is obsoleted by php-pecl-mcrypt, trying to install php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 instead
Error: Package: php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 (remi-php73)
Requires: php(api) = 20180731-64
Installing: php-common-5.4.16-46.el7.x86_64 (base)
php(api) = 20100412-64
Available: php55w-common-5.5.38-1.w7.x86_64 (webtatic)
php(api) = 20121113-64
Available: php56w-common-5.6.39-1.w7.x86_64 (webtatic)
php(api) = 20131106-64
Available: php56w-common-5.6.40-1.w7.x86_64 (webtatic)
php(api) = 20131106-64
Available: php70w-common-7.0.33-1.w7.x86_64 (webtatic)
php(api) = 20151012-64
Available: php71u-common-7.1.25-1.ius.centos7.x86_64 (ius)
php(api) = 20160303-64
Available: php71u-common-7.1.25-2.ius.centos7.x86_64 (ius)
php(api) = 20160303-64
Available: php71u-common-7.1.26-1.ius.centos7.x86_64 (ius)
php(api) = 20160303-64
Available: php71w-common-7.1.25-1.w7.x86_64 (webtatic)
php(api) = 20160303-64
Available: php71w-common-7.1.26-1.w7.x86_64 (webtatic)
php(api) = 20160303-64
Available: php72u-common-7.2.13-1.ius.centos7.x86_64 (ius)
php(api) = 20170718-64
Available: php72u-common-7.2.13-2.ius.centos7.x86_64 (ius)
php(api) = 20170718-64
Available: php72u-common-7.2.14-1.ius.centos7.x86_64 (ius)
php(api) = 20170718-64
Available: php72w-common-7.2.13-1.w7.x86_64 (webtatic)
php(api) = 20170718-64
Available: php72w-common-7.2.14-1.w7.x86_64 (webtatic)
php(api) = 20170718-64
Error: Package: php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 (remi-php73)
Requires: php(zend-abi) = 20180731-64
Installing: php-common-5.4.16-46.el7.x86_64 (base)
php(zend-abi) = 20100525-64
Available: php55w-common-5.5.38-1.w7.x86_64 (webtatic)
php(zend-abi) = 20121212-64
Available: php56w-common-5.6.39-1.w7.x86_64 (webtatic)
php(zend-abi) = 20131226-64
Available: php56w-common-5.6.40-1.w7.x86_64 (webtatic)
php(zend-abi) = 20131226-64
Available: php70w-common-7.0.33-1.w7.x86_64 (webtatic)
php(zend-abi) = 20151012-64
Available: php71u-common-7.1.25-1.ius.centos7.x86_64 (ius)
php(zend-abi) = 20160303-64
Available: php71u-common-7.1.25-2.ius.centos7.x86_64 (ius)
php(zend-abi) = 20160303-64
Available: php71u-common-7.1.26-1.ius.centos7.x86_64 (ius)
php(zend-abi) = 20160303-64
Available: php71w-common-7.1.25-1.w7.x86_64 (webtatic)
php(zend-abi) = 20160303-64
Available: php71w-common-7.1.26-1.w7.x86_64 (webtatic)
php(zend-abi) = 20160303-64
Available: php72u-common-7.2.13-1.ius.centos7.x86_64 (ius)
php(zend-abi) = 20170718-64
Available: php72u-common-7.2.13-2.ius.centos7.x86_64 (ius)
php(zend-abi) = 20170718-64
Available: php72u-common-7.2.14-1.ius.centos7.x86_64 (ius)
php(zend-abi) = 20170718-64
Available: php72w-common-7.2.13-1.w7.x86_64 (webtatic)
php(zend-abi) = 20170718-64
Available: php72w-common-7.2.14-1.w7.x86_64 (webtatic)
php(zend-abi) = 20170718-64
Error: Package: php-opcache-7.3.2-1.el7.remi.x86_64 (remi-php73)
Requires: php-common(x86-64) = 7.3.2-1.el7.remi
Installing: php-common-5.4.16-46.el7.x86_64 (base)
php-common(x86-64) = 5.4.16-46.el7
Available: php55w-common-5.5.38-1.w7.x86_64 (webtatic)
php-common(x86-64) = 5.5.38-1.w7
Available: php56w-common-5.6.39-1.w7.x86_64 (webtatic)
php-common(x86-64) = 5.6.39-1.w7
Available: php56w-common-5.6.40-1.w7.x86_64 (webtatic)
php-common(x86-64) = 5.6.40-1.w7
Available: php70w-common-7.0.33-1.w7.x86_64 (webtatic)
php-common(x86-64) = 7.0.33-1.w7
Available: php71u-common-7.1.25-1.ius.centos7.x86_64 (ius)
php-common(x86-64) = 7.1.25-1.ius.centos7
Available: php71u-common-7.1.25-2.ius.centos7.x86_64 (ius)
php-common(x86-64) = 7.1.25-2.ius.centos7
Available: php71u-common-7.1.26-1.ius.centos7.x86_64 (ius)
php-common(x86-64) = 7.1.26-1.ius.centos7
Available: php71w-common-7.1.25-1.w7.x86_64 (webtatic)
php-common(x86-64) = 7.1.25-1.w7
Available: php71w-common-7.1.26-1.w7.x86_64 (webtatic)
php-common(x86-64) = 7.1.26-1.w7
Available: php72u-common-7.2.13-1.ius.centos7.x86_64 (ius)
php-common(x86-64) = 7.2.13-1.ius.centos7
Available: php72u-common-7.2.13-2.ius.centos7.x86_64 (ius)
php-common(x86-64) = 7.2.13-2.ius.centos7
Available: php72u-common-7.2.14-1.ius.centos7.x86_64 (ius)
php-common(x86-64) = 7.2.14-1.ius.centos7
Available: php72w-common-7.2.13-1.w7.x86_64 (webtatic)
php-common(x86-64) = 7.2.13-1.w7
Available: php72w-common-7.2.14-1.w7.x86_64 (webtatic)
php-common(x86-64) = 7.2.14-1.w7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
$ sudo yum install --skip-broken php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd
Package php-mcrypt is obsoleted by php-pecl-mcrypt, trying to install php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 instead
Packages skipped because of dependency problems:
libmcrypt-2.5.8-13.el7.x86_64 from epel
php-opcache-7.3.2-1.el7.remi.x86_64 from remi-php73
php-pecl-mcrypt-1.0.2-2.el7.remi.7.3.x86_64 from remi-php73
===============================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================
Installing:
php x86_64 5.4.16-46.el7 base 1.4 M
php-cli x86_64 5.4.16-46.el7 base 2.7 M
php-common x86_64 5.4.16-46.el7 base 565 k
php-gd x86_64 5.4.16-46.el7 base 128 k
php-mysqlnd x86_64 5.4.16-46.el7 base 174 k
Installing for dependencies:
php-pdo x86_64 5.4.16-46.el7 base 99 k
Skipped (dependency problems):
libmcrypt x86_64 2.5.8-13.el7 epel 99 k
php-opcache x86_64 7.3.2-1.el7.remi remi-php73 304 k
php-pecl-mcrypt x86_64 1.0.2-2.el7.remi.7.3 remi-php73 29 k
Transaction Summary
===============================================================================================================================================
Install 5 Packages (+1 Dependent package)
Skipped (dependency problems) 3 Packages
Is this ok [y/d/N]: y
$ php -v
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
yum update
吗? - Ataur Rahman