ubuntu 切换php版本

切换PHP版本

sudo update-alternatives --config PHP

过程如下

root@JD:/var/www/bbs# PHP -v
PHP 7.4.1 (cli) (built: Dec 18 2019 14:44:22) ( NTS )
copyright (c) The PHP Group
Zend Engine v3.4.0, copyright (c) Zend Technologies
    with Zend OPcache v7.4.1, copyright (c), by Zend Technologies
root@JD:/var/www/bbs# ^C
root@JD:/var/www/bbs# sudo update-alternatives --config PHP
There are 2 choices for the alternative PHP (providing /usr/bin/PHP).

  Selection    Path             Priority   Status
------------------------------------------------------------
* 0            /usr/bin/PHP7.4   74        auto mode
  1            /usr/bin/PHP7.3   73        manual mode
  2            /usr/bin/PHP7.4   74        manual mode

Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/PHP7.3 to provide /usr/bin/PHP (PHP) in manual mode
root@JD:/var/www/bbs# service PHP7.3-fpm restart
root@JD:/var/www/bbs# service Nginx restart
root@JD:/var/www/bbs# PHP -v
PHP 7.3.13-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec 18 2019 14:48:49) ( NTS )
copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.13, copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.13-1+ubuntu18.04.1+deb.sury.org+1, copyright (c) 1999-2018, by Zend Technologies

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...