其实就是一条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命令进行前后版本对比即可看出。

相关文章:

  • 2021-10-01
  • 2021-09-08
  • 2021-07-07
  • 2022-12-23
  • 2021-08-22
  • 2021-04-08
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2021-05-23
  • 2021-12-25
  • 2021-07-25
  • 2021-12-16
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案