I have installed php 5.6 and php 7.1 on Ubuntu 16.04
I know I can do it using Apache as my web server
a2enmod php5.6 #to enable php5 a2enmod php7.1 #to enable php7
When I disable php7.1 and enable php 5.6 in the Apache module, Apache recognizes the change and uses the php 5.6 interpreter as expected.
But when I run the internal php web server from the command line:
php -S localhost:8888
php uses php 7 to handle requests. So how do I switch between php 5.6 and php 7.1 from the command line?
Interactive switching mode
Manual switching
From PHP 5.6 => PHP 7.1
Your system settings default to PHP 5.6, you need to switch to PHP 7.1.
Apache:
Command Line:
From PHP 7.1 => PHP 5.6
Your system is set to default PHP 7.1, you need to switch to PHP 5.6.
Apache:
Command Line:
source