Switch PHP Versions on Command Line in Ubuntu 16.04
Issue: How can you switch between PHP versions (5.6 and 7.1) in the command line on Ubuntu 16.04 while using the internal PHP web server?
Solution:
There are two main methods to switch PHP versions in the command line:
Interactive Switching Mode:
Use the following commands to enter the interactive switching mode:
Select the desired PHP version and confirm your choice.
Manual Switching:
From PHP 5.6 to PHP 7.1
Apache:
Command Line:
From PHP 7.1 to PHP 5.6
Apache:
Command Line:
Credit:
The provided solution is sourced from:
The above is the detailed content of How to Switch Between PHP Versions (5.6 and 7.1) on the Command Line in Ubuntu 16.04?. For more information, please follow other related articles on the PHP Chinese website!