Ubuntu16.04中php如何切换版本

其实就是一条Linux命令,如下:

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.1   71        auto mode
  1            /usr/bin/php7.0   70        manual mode
  2            /usr/bin/php7.1   71        manual mode
Press <enter> to keep the current choice[*], or type selection number:

输入其中一项数字即可实现php版本切换

如何判断版本是否切换成功?
php -v命令进行前后版本对比即可看出。

猜你喜欢

转载自www.cnblogs.com/youcong/p/10703463.html