系统相关
首页 > 系统相关> > ubuntu 切换php版本

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

标签:www,Copyright,Zend,var,切换,ubuntu,JD,php
来源: https://blog.csdn.net/rzfanfan/article/details/117254314