在CentOS 6.5上将PHP 5.4降级到5.3?

我试图将 PHP从5.5.8降级到5.3.x.
我试过这个,但它对我有用.
yum downgrade PHP

我得到的错误

Loaded plugins: fastestmirror,refresh-packagekit,security
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
* Webmin: webmin.mirror.somersettechsolutions.co.uk
* base: centos.excellmedia.net
* epel: epel.mirror.net.in
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
No Match for available package: PHP-5.3.3-26.el6.x86_64
nothing to do

我也试过这个,但即便是这个对我有用.

sudo yum downgrade PHP PHP-common PHP-cli

我得到的错误日志是

Loaded plugins: fastestmirror,security
    Setting up Downgrade Process
    Loading mirror speeds from cached hostfile
     * Webmin: webmin.mirror.somersettechsolutions.co.uk
     * base: centos.excellmedia.net
     * epel: epel.mirror.net.in
     * extras: centos.excellmedia.net
     * updates: centos.excellmedia.net
    No Match for available package: PHP-5.3.3-26.el6.x86_64
    Resolving Dependencies
    --> Running transaction check
    ---> Package PHP-cli.x86_64 0:5.3.3-27.el6_5 will be a downgrade
    ---> Package PHP-cli.x86_64 0:5.5.8-1.el6.remi will be erased
    ---> Package PHP-common.x86_64 0:5.3.3-27.el6_5 will be a downgrade
    ---> Package PHP-common.x86_64 0:5.5.8-1.el6.remi will be erased
    ---> Package PHP-pecl-zip.x86_64 0:1.12.4-1.el6.remi.5.5 will be obsoleted
    --> Finished Dependency Resolution
    Error: Package: PHP-pecl-memcached-2.1.0-7.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-process-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
               Requires: PHP-common(x86-64) = 5.5.8-1.el6.remi
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP-common(x86-64) = 5.5.8-1.el6.remi
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP-common(x86-64) = 5.3.3-27.el6_5
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP-common(x86-64) = 5.3.3-26.el6
    Error: Package: PHP-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-memcached-2.1.0-7.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-mongo-1.4.5-1.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-mongo-1.4.5-1.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-gd-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
               Requires: PHP-common(x86-64) = 5.5.8-1.el6.remi
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP-common(x86-64) = 5.5.8-1.el6.remi
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP-common(x86-64) = 5.3.3-27.el6_5
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP-common(x86-64) = 5.3.3-26.el6
    Error: Package: PHP-pecl-sqlite-2.0.0-0.4.svn332053.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-memcache-3.0.8-1.el6.remi.1.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-apcu-4.0.3-1.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-memcache-3.0.8-1.el6.remi.1.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-mbstring-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
               Requires: PHP-common(x86-64) = 5.5.8-1.el6.remi
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP-common(x86-64) = 5.5.8-1.el6.remi
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP-common(x86-64) = 5.3.3-27.el6_5
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP-common(x86-64) = 5.3.3-26.el6
    Error: Package: PHP-mcrypt-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
               Requires: PHP-common(x86-64) = 5.5.8-1.el6.remi
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP-common(x86-64) = 5.5.8-1.el6.remi
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP-common(x86-64) = 5.3.3-27.el6_5
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP-common(x86-64) = 5.3.3-26.el6
    Error: Package: PHP-pecl-jsonc-1.3.3-1.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(zend-abi) = 20121212-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(zend-abi) = 20121212-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(zend-abi) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(zend-abi) = 20090626
    Error: Package: PHP-pecl-jsonc-1.3.3-1.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-xml-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
               Requires: PHP-common(x86-64) = 5.5.8-1.el6.remi
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP-common(x86-64) = 5.5.8-1.el6.remi
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP-common(x86-64) = 5.3.3-27.el6_5
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP-common(x86-64) = 5.3.3-26.el6
    Error: Package: PHP-pecl-apcu-4.0.3-1.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-pecl-sqlite-2.0.0-0.4.svn332053.el6.remi.5.5.x86_64 (@remi-PHP55)
               Requires: PHP(api) = 20121113-64
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP(api) = 20121113-64
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP(api) = 20090626
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP(api) = 20090626
    Error: Package: PHP-pdo-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
               Requires: PHP-common(x86-64) = 5.5.8-1.el6.remi
               Removing: PHP-common-5.5.8-1.el6.remi.x86_64 (@remi-PHP55)
                   PHP-common(x86-64) = 5.5.8-1.el6.remi
               Downgraded By: PHP-common-5.3.3-27.el6_5.x86_64 (updates)
                   PHP-common(x86-64) = 5.3.3-27.el6_5
               Available: PHP-common-5.3.3-26.el6.x86_64 (base)
                   PHP-common(x86-64) = 5.3.3-26.el6
     You Could try using --skip-broken to work around the problem
     You Could try running: rpm -Va --nofiles --nodigest
    [root@centos1 /]# PHP -v
    PHP 5.5.8 (cli) (built: Jan  9 2014 08:14:44)
    copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.5.0,copyright (c) 1998-2013 Zend Technologies

请帮帮我.

看来你已经从remi存储库安装了很多额外的PHP模块.当您降级PHP时,依赖性不再可用.您也可以尝试降级它们
yum downgrade PHP*

但这可能也会失败,因为标准存储库中并非所有这些软件包都可用

我建议先删除所有PHP包:

yum remove PHP*

之后,您可以从标准仓库重新安装所需的软件包:

yum install PHP PHP-cli ...

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native