Centos 7 nginx php 升级

Centos 7 nginx php 升级

我当前运行的网站运行良好,它当前使用的是 php 5.4.45 FPM/FastCGI,但是我想升级到 php 5.5.9+,以便使用具有该 php 要求的 api 文档子域。经过大约 4 个小时的搜索和尝试,使用 yum 更新得到的结果是未找到任何软件包,我不确定该怎么办?如果我查看可用的软件包,它们就在那里,但如果我尝试更新,则没有可用的更新..我做错了什么吗?

好的,我已经安装好了,但现在出现了网关错误,虽然已经安装了 5.5.31,但它仍然显示我正在使用 5.4.45

    Total                                               45 MB/s |  39 MB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : llvm-libs-3.4.2-8.el7.x86_64                                1/23
  Updating   : llvm-3.4.2-8.el7.x86_64                                     2/23
  Updating   : clang-3.4.2-8.el7.x86_64                                    3/23
  Installing : libzip-last-1.0.1-1.el7.remi.x86_64                         4/23
  Installing : php-pecl-zip-1.13.1-1.el7.remi.5.5.x86_64                   5/23

WARNING : These php-* RPMs are not official Fedora / Red Hat build and
overrides the official ones. Don't file bugs on Fedora Project nor Red Hat.

Use dedicated forum at http://forum.remirepo.net/

  Updating   : php-common-5.5.31-1.el7.remi.x86_64                         6/23
warning: /etc/php.ini created as /etc/php.ini.rpmnew
  Installing : php-pecl-jsonc-1.3.9-1.el7.remi.5.5.x86_64                  7/23
  Updating   : php-pdo-5.5.31-1.el7.remi.x86_64                            8/23
  Updating   : php-cli-5.5.31-1.el7.remi.x86_64                            9/23
  Updating   : php-5.5.31-1.el7.remi.x86_64                               10/23
  Installing : php-mysqlnd-5.5.31-1.el7.remi.x86_64                       11/23
  Updating   : php-fpm-5.5.31-1.el7.remi.x86_64                           12/23
warning: /etc/php-fpm.d/www.conf created as /etc/php-fpm.d/www.conf.rpmnew
  Updating   : clang-devel-3.4.2-8.el7.x86_64                             13/23
  Cleanup    : php-5.4.16-36.el7_1.x86_64                                 14/23
  Cleanup    : php-cli-5.4.16-36.el7_1.x86_64                             15/23
  Cleanup    : clang-devel-3.4.2-7.el7.x86_64                             16/23
  Erasing    : php-mysql-5.4.16-36.el7_1.x86_64                           17/23
  Cleanup    : php-pdo-5.4.16-36.el7_1.x86_64                             18/23
  Cleanup    : php-fpm-5.4.16-36.el7_1.x86_64                             19/23
  Cleanup    : clang-3.4.2-7.el7.x86_64                                   20/23
  Cleanup    : php-common-5.4.16-36.el7_1.x86_64                          21/23
  Cleanup    : llvm-3.4.2-7.el7.x86_64                                    22/23
  Cleanup    : llvm-libs-3.4.2-7.el7.x86_64                               23/23
  Verifying  : php-pecl-jsonc-1.3.9-1.el7.remi.5.5.x86_64                  1/23
  Verifying  : php-pdo-5.5.31-1.el7.remi.x86_64                            2/23
  Verifying  : php-fpm-5.5.31-1.el7.remi.x86_64                            3/23
  Verifying  : clang-3.4.2-8.el7.x86_64                                    4/23
  Verifying  : libzip-last-1.0.1-1.el7.remi.x86_64                         5/23
  Verifying  : php-mysqlnd-5.5.31-1.el7.remi.x86_64                        6/23
  Verifying  : php-cli-5.5.31-1.el7.remi.x86_64                            7/23
  Verifying  : php-5.5.31-1.el7.remi.x86_64                                8/23
  Verifying  : php-common-5.5.31-1.el7.remi.x86_64                         9/23
  Verifying  : php-pecl-zip-1.13.1-1.el7.remi.5.5.x86_64                  10/23
  Verifying  : clang-devel-3.4.2-8.el7.x86_64                             11/23
  Verifying  : llvm-libs-3.4.2-8.el7.x86_64                               12/23
  Verifying  : llvm-3.4.2-8.el7.x86_64                                    13/23
  Verifying  : php-5.4.16-36.el7_1.x86_64                                 14/23
  Verifying  : clang-devel-3.4.2-7.el7.x86_64                             15/23
  Verifying  : llvm-3.4.2-7.el7.x86_64                                    16/23
  Verifying  : llvm-libs-3.4.2-7.el7.x86_64                               17/23
  Verifying  : php-cli-5.4.16-36.el7_1.x86_64                             18/23
  Verifying  : php-mysql-5.4.16-36.el7_1.x86_64                           19/23
  Verifying  : clang-3.4.2-7.el7.x86_64                                   20/23
  Verifying  : php-common-5.4.16-36.el7_1.x86_64                          21/23
  Verifying  : php-fpm-5.4.16-36.el7_1.x86_64                             22/23
  Verifying  : php-pdo-5.4.16-36.el7_1.x86_64                             23/23

Installed:
  php-mysqlnd.x86_64 0:5.5.31-1.el7.remi

Dependency Installed:
  libzip-last.x86_64 0:1.0.1-1.el7.remi
  php-pecl-jsonc.x86_64 0:1.3.9-1.el7.remi.5.5
  php-pecl-zip.x86_64 0:1.13.1-1.el7.remi.5.5

Updated:
  clang.x86_64 0:3.4.2-8.el7               clang-devel.x86_64 0:3.4.2-8.el7
  llvm.x86_64 0:3.4.2-8.el7                llvm-libs.x86_64 0:3.4.2-8.el7
  php.x86_64 0:5.5.31-1.el7.remi           php-cli.x86_64 0:5.5.31-1.el7.remi
  php-common.x86_64 0:5.5.31-1.el7.remi    php-fpm.x86_64 0:5.5.31-1.el7.remi
  php-pdo.x86_64 0:5.5.31-1.el7.remi

Replaced:
  php-mysql.x86_64 0:5.4.16-36.el7_1

Complete!
[root@ns369459 ~]# php -v
PHP Warning:  Version warning: Imagick was compiled against Image Magick version 1682 but version 1683 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
PHP 5.4.45 (cli) (built: Sep 24 2015 18:48:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
    with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
[root@ns369459 ~]# service nginx restart
Restarting nginx (via systemctl):                          [  OK  ]
[root@ns369459 ~]# php -v
PHP Warning:  Version warning: Imagick was compiled against Image Magick version 1682 but version 1683 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
PHP 5.4.45 (cli) (built: Sep 24 2015 18:48:03)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
    with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
[root@ns369459 ~]# reboot

答案1

安装 repo

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

从官方仓库中删除所有已安装的软件包

yum remove php-*

从外部包安装包

yum install php56w php56w-opcache php56w-fpm php56w-mysql 

然后重新启动 fpm。

相关内容