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命令进行前后版本对比即可看出。

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...