在 CentOS 上从 PHP 5 更新到 PHP 7 时出现问题

在 CentOS 上从 PHP 5 更新到 PHP 7 时出现问题

我一直尝试遵循的说明看起来很简单,如下所示:将 PHP 从 5 更新至 7但我总是遇到一些错误。在链接的示例中,所有命令似乎都可以正常工作,但当我执行实际的安装命令时

yum install php php-common php-cli php-mysql

我得到这个输出:

Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.heanet.ie
 * epel: www.mirrorservice.org
 * extras: ftp.heanet.ie
 * ius: lon.mirror.rackspace.com
 * remi-php70: mirror.netweaver.uk
 * remi-php73: mirror.netweaver.uk
 * remi-safe: mirror.netweaver.uk
 * updates: ftp.heanet.ie
 * webtatic: uk.repo.webtatic.com
remi-php70                                                                                                                                                                                 | 3.0 kB  00:00:00     
remi-php70/primary_db                                                                                                                                                                      | 229 kB  00:00:00     
Package php-mysql is obsoleted by php-mysqlnd, trying to install php-mysqlnd-7.3.9-1.el7.remi.x86_64 instead
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: libargon2.so.0()(64bit) for package: php-7.3.9-1.el7.remi.x86_64
---> Package php-cli.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php-common.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: php-json(x86-64) = 7.3.9-1.el7.remi for package: php-common-7.3.9-1.el7.remi.x86_64
---> Package php-mysqlnd.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: php-pdo(x86-64) = 7.3.9-1.el7.remi for package: php-mysqlnd-7.3.9-1.el7.remi.x86_64
---> Package php56u.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-cli.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-cli for package: 1:php56u-pear-1.10.5-1.ius.centos7.noarch
--> Processing Dependency: php56u-cli(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-devel-5.6.38-1.ius.centos7.x86_64
---> Package php56u-common.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-mbstring-5.6.38-1.ius.centos7.x86_64
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-bcmath-5.6.38-1.ius.centos7.x86_64
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-gd-5.6.38-1.ius.centos7.x86_64
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-process-5.6.38-1.ius.centos7.x86_64
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-intl-5.6.38-1.ius.centos7.x86_64
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-mcrypt-5.6.38-1.ius.centos7.x86_64
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
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-opcache-5.6.38-1.ius.centos7.x86_64
--> Processing Dependency: php56u-common(x86-64) = 5.6.38-1.ius.centos7 for package: php56u-xml-5.6.38-1.ius.centos7.x86_64
---> Package php56u-mysqlnd.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Running transaction check
---> Package libargon2.x86_64 0:20161029-3.el7 will be installed
---> Package php-bcmath.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php-devel.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: gcc for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: gcc-c++ for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: krb5-devel(x86-64) for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libargon2-devel(x86-64) for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libedit-devel(x86-64) for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libtool for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libxml2-devel(x86-64) for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: openssl-devel(x86-64) for package: php-devel-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: zlib-devel(x86-64) for package: php-devel-7.3.9-1.el7.remi.x86_64
---> Package php-gd.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: gd-last(x86-64) >= 2.1.1 for package: php-gd-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libgd.so.3()(64bit) for package: php-gd-7.3.9-1.el7.remi.x86_64
---> Package php-intl.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: libicudata.so.62()(64bit) for package: php-intl-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libicui18n.so.62()(64bit) for package: php-intl-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libicuio.so.62()(64bit) for package: php-intl-7.3.9-1.el7.remi.x86_64
--> Processing Dependency: libicuuc.so.62()(64bit) for package: php-intl-7.3.9-1.el7.remi.x86_64
---> Package php-json.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php-mbstring.x86_64 0:7.3.9-1.el7.remi will be obsoleting
--> Processing Dependency: libonig.so.5()(64bit) for package: php-mbstring-7.3.9-1.el7.remi.x86_64
---> Package php-opcache.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php-pdo.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php-pear.noarch 1:1.10.9-3.el7.remi will be obsoleting
--> Processing Dependency: php-composer(fedora/autoloader) for package: 1:php-pear-1.10.9-3.el7.remi.noarch
---> Package php-pecl-mcrypt.x86_64 0:1.0.2-2.el7.remi.7.3 will be obsoleting
---> Package php-process.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php-xml.x86_64 0:7.3.9-1.el7.remi will be obsoleting
---> Package php56u-bcmath.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-devel.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-devel(x86-64) for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package php56u-gd.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-intl.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-mbstring.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-mcrypt.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-opcache.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-pdo.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-pear.noarch 1:1.10.5-1.ius.centos7 will be obsoleted
---> Package php56u-pecl-jsonc.x86_64 0:1.3.10-2.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7 for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package php56u-process.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
---> Package php56u-xml.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-36.el7_6.2 will be installed
--> Processing Dependency: libgomp = 4.8.5-36.el7_6.2 for package: gcc-4.8.5-36.el7_6.2.x86_64
--> Processing Dependency: cpp = 4.8.5-36.el7_6.2 for package: gcc-4.8.5-36.el7_6.2.x86_64
--> Processing Dependency: libgcc >= 4.8.5-36.el7_6.2 for package: gcc-4.8.5-36.el7_6.2.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-36.el7_6.2.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-36.el7_6.2.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-36.el7_6.2.x86_64
---> Package gcc-c++.x86_64 0:4.8.5-36.el7_6.2 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-36.el7_6.2 for package: gcc-c++-4.8.5-36.el7_6.2.x86_64
--> Processing Dependency: libstdc++ = 4.8.5-36.el7_6.2 for package: gcc-c++-4.8.5-36.el7_6.2.x86_64
---> Package gd-last.x86_64 0:2.2.5-8.el7.remi will be installed
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-last-2.2.5-8.el7.remi.x86_64
--> Processing Dependency: libwebp.so.7()(64bit) for package: gd-last-2.2.5-8.el7.remi.x86_64
---> Package krb5-devel.x86_64 0:1.15.1-37.el7_6 will be installed
--> Processing Dependency: libkadm5(x86-64) = 1.15.1-37.el7_6 for package: krb5-devel-1.15.1-37.el7_6.x86_64
--> Processing Dependency: libverto-devel for package: krb5-devel-1.15.1-37.el7_6.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.1-37.el7_6.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.1-37.el7_6.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.1-37.el7_6.x86_64
---> Package libargon2-devel.x86_64 0:20161029-3.el7 will be installed
---> Package libedit-devel.x86_64 0:3.0-12.20121213cvs.el7 will be installed
--> Processing Dependency: ncurses-devel for package: libedit-devel-3.0-12.20121213cvs.el7.x86_64
---> Package libicu62.x86_64 0:62.1-3.el7.remi will be installed
---> Package libtool.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package libxml2-devel.x86_64 0:2.9.1-6.el7_2.3 will be installed
--> Processing Dependency: xz-devel for package: libxml2-devel-2.9.1-6.el7_2.3.x86_64
---> Package oniguruma5.x86_64 0:6.9.3-1.el7.remi will be installed
---> Package openssl-devel.x86_64 1:1.0.2k-16.el7_6.1 will be installed
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-16.el7_6.1 for package: 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64
---> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
---> Package php56u-devel.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-devel(x86-64) for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package php56u-pecl-jsonc.x86_64 0:1.3.10-2.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7 for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-36.el7_6.2 will be installed
---> Package fontconfig.x86_64 0:2.13.0-4.3.el7 will be installed
--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.13.0-4.3.el7.x86_64
--> Processing Dependency: dejavu-sans-fonts for package: fontconfig-2.13.0-4.3.el7.x86_64
---> Package glibc-devel.x86_64 0:2.17-260.el7_6.6 will be installed
--> Processing Dependency: glibc-headers = 2.17-260.el7_6.6 for package: glibc-devel-2.17-260.el7_6.6.x86_64
--> Processing Dependency: glibc = 2.17-260.el7_6.6 for package: glibc-devel-2.17-260.el7_6.6.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-260.el7_6.6.x86_64
---> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
---> Package libcom_err-devel.x86_64 0:1.42.9-13.el7 will be installed
---> Package libgcc.i686 0:4.8.5-36.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-36.el7 will be updated
---> Package libgcc.i686 0:4.8.5-36.el7_6.2 will be an update
---> Package libgcc.x86_64 0:4.8.5-36.el7_6.2 will be an update
---> Package libgomp.x86_64 0:4.8.5-36.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-36.el7_6.2 will be an update
---> Package libkadm5.x86_64 0:1.15.1-37.el7_6 will be installed
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package libselinux-devel.x86_64 0:2.5-14.1.el7 will be installed
--> Processing Dependency: libsepol-devel(x86-64) >= 2.5-10 for package: libselinux-devel-2.5-14.1.el7.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-14.1.el7.x86_64
---> Package libstdc++.i686 0:4.8.5-36.el7 will be updated
---> Package libstdc++.x86_64 0:4.8.5-36.el7 will be updated
---> Package libstdc++.i686 0:4.8.5-36.el7_6.2 will be an update
---> Package libstdc++.x86_64 0:4.8.5-36.el7_6.2 will be an update
---> Package libstdc++-devel.x86_64 0:4.8.5-36.el7_6.2 will be installed
---> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
---> Package libwebp7.x86_64 0:1.0.2-1.el7.remi will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
---> Package ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 will be installed
---> Package openssl-libs.x86_64 1:1.0.2k-16.el7 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-16.el7 for package: 1:openssl-1.0.2k-16.el7.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-16.el7_6.1 will be an update
---> Package php56u-devel.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-devel(x86-64) for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package php56u-pecl-jsonc.x86_64 0:1.3.10-2.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7 for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package xz-devel.x86_64 0:5.2.2-1.el7 will be installed
--> Running transaction check
---> Package dejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed
--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-sans-fonts-2.33-6.el7.noarch
---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed
---> Package glibc.i686 0:2.17-260.el7_6.3 will be updated
--> Processing Dependency: glibc = 2.17-260.el7_6.3 for package: glibc-common-2.17-260.el7_6.3.x86_64
---> Package glibc.x86_64 0:2.17-260.el7_6.3 will be updated
---> Package glibc.i686 0:2.17-260.el7_6.6 will be an update
---> Package glibc.x86_64 0:2.17-260.el7_6.6 will be an update
---> Package glibc-headers.x86_64 0:2.17-260.el7_6.6 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-260.el7_6.6.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-260.el7_6.6.x86_64
---> Package libsepol-devel.x86_64 0:2.5-10.el7 will be installed
---> Package openssl.x86_64 1:1.0.2k-16.el7 will be updated
---> Package openssl.x86_64 1:1.0.2k-16.el7_6.1 will be an update
---> Package php56u-devel.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-devel(x86-64) for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package php56u-pecl-jsonc.x86_64 0:1.3.10-2.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7 for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
--> Running transaction check
---> Package dejavu-fonts-common.noarch 0:2.33-6.el7 will be installed
---> Package glibc-common.x86_64 0:2.17-260.el7_6.3 will be updated
---> Package glibc-common.x86_64 0:2.17-260.el7_6.6 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-957.27.2.el7 will be installed
---> Package php56u-devel.x86_64 0:5.6.38-1.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-devel(x86-64) for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
---> Package php56u-pecl-jsonc.x86_64 0:1.3.10-2.ius.centos7 will be obsoleted
--> Processing Dependency: php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7 for package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64
--> Finished Dependency Resolution
Error: Package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64 (@ius)
           Requires: php56u-devel(x86-64)
           Removing: php56u-devel-5.6.38-1.ius.centos7.x86_64 (@ius)
               php56u-devel(x86-64) = 5.6.38-1.ius.centos7
           Obsoleted By: php-devel-7.3.9-1.el7.remi.x86_64 (remi-php73)
               Not found
Error: Package: php56u-pecl-jsonc-devel-1.3.10-2.ius.centos7.x86_64 (@ius)
           Requires: php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7
           Removing: php56u-pecl-jsonc-1.3.10-2.ius.centos7.x86_64 (@ius)
               php56u-pecl-jsonc(x86-64) = 1.3.10-2.ius.centos7
           Obsoleted By: php-json-7.3.9-1.el7.remi.x86_64 (remi-php73)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

PHP 版本停留在 5.6.38。不知道如何解决这个问题,希望得到帮助!

答案1

您应该删除php56u-pecl-jsonc,因为存储库中没有等效内容。

佩克尔是 PHP C 扩展的存储库,有时会导致冲突。PHP 有一个非常好的 json 库,这是一个替代方案,如果您不需要,可以删除:

yum remove php56u-pecl-jsonc

或者使用此命令删除所有 PHP 包 - 但要小心操作:

rpm -qa '*php*' | xargs yum remove -y

然后,为了安全起见,清理缓存并安装新的:

yum clean all
yum install php php-common php-cli php-mysql

这应该可以解决。

相关内容