Ubuntu16.04中php如何切换版本

前端之家收集整理的这篇文章主要介绍了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.        manual mode
Press <enter> to keep the current choice[*],or type selection number:

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

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

猜你在找的Linux相关文章