duanlinjian5819 2019-01-09 19:29
浏览 174

too long

I needed try PHP 5.6 and 5.5 on on Centos 7. So, I installed them overtop of a perfect working installation of PHP 7.1. I followed the instructions here: https://www.mojowill.com/geek/howto-install-php-5-4-5-5-or-5-6-on-centos-6-and-centos-7/

Basically, I edited the remi repo config file to enable PHP 5.6 and 5.5 and installed PHP 5.6. I tested what I wanted to test and tried to switch back by disabling the repos and uninstall all php and then reinstall again. Now I have problems.

Here are the symptoms and what I've tried.

I get a message on a WordPress installation "Your PHP installation appears to be missing the MySQL extension which is required by WordPress."

# php -v
PHP **7.2.14** (cli) (built: Jan  8 2019 14:05:15) ( NTS )
Copyright (c) 1997-2018 The PHP Group

<? phpinfo() ?> works but says php version **7.1.24**

I tried to check if php-mysql is still installed:

# yum list installed | grep php
php.x86_64                              7.2.14-1.el7.remi              @remi-php72
php-cli.x86_64                          7.2.14-1.el7.remi              @remi-php72
php-common.x86_64                       7.2.14-1.el7.remi              @remi-php72
php-gd.x86_64                           7.2.14-1.el7.remi              @remi-php72
php-json.x86_64                         7.2.14-1.el7.remi              @remi-php72
php-mysqlnd.x86_64                      7.2.14-1.el7.remi              @remi-php72
php-pdo.x86_64                          7.2.14-1.el7.remi              @remi-php72
php-pecl-mcrypt.x86_64                  1.0.1-6.el7.remi.7.2           @remi-php72


# yum install php-mysql
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.layeronline.com
 * epel: mirror.uic.edu
 * extras: centos.mirror.globo.tech
 * nux-dextop: mirror.li.nux.ro
 * remi: repo1.ash.innoscale.net
 * remi-php72: repo1.ash.innoscale.net
 * remi-safe: repo1.ash.innoscale.net
 * updates: centos.mirror.ca.planethoster.net
 * webtatic: us-east.repo.webtatic.com
Package php-mysql-5.4.45-16.el7.remi.x86_64 is obsoleted by php-mysqlnd-7.2.14-1.el7.remi.x86_64 which is already installed

Is there any easy resolution to this mess, or should I just fresh install the whole development machine.

  • 写回答

1条回答 默认 最新

  • dssqq82402 2019-01-09 20:46
    关注

    First remove everything regarding old php version (will take some time...)

        sudo yum remove --setopt=clean_requirements_on_remove=1 php php-pear php-mysql php-cli php-common mod-php
    

    then, install newer version (will take even more time)

        sudo yum install mod_php70u php70u-cli php70u-mysqlnd
    

    dont forget to do restart and check sudo apachectl restart systemctl status httpd

    If you're running fpm with NGinX then use following uninstall (this will keep the config's just o remove packages / dependencies)

        sudo yum remove --setopt=clean_requirements_on_remove=1 php-fpm php-cli php-common php7-fpm php7-cli php7-common
    

    and install

        sudo yum install php7-fpm-nginx php7-cli php7-mysqlnd
    

    (use [72] instead of [7] if you need to)

    save, exit and restart

        sudo systemctl restart php-fpm
        sudo systemctl restart nginx #(or whatever you use)
    

    please consider stepping down to version 7.1, as that might be a little less pain connecting modules than latest version, especially on always problematic centOS

    (thanks @fyrye for options on remove)

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向