Switch php versions on commandline ubuntu 16 04

0 votes

On my Ubuntu 16.04, I've installed PHP 5.6 and PHP 7.1.

With Apache as my web server, I am aware that I:

a2enmod php5.6 #to enable php5
a2enmod php7.1 #to enable php7

Apache notices the change and uses the PHP 5.6 interpreter as predicted when I disable php7.1 in the Apache modules and enable PHP 5.6.

But when I use the command line to run the internal PHP web server:

php -S localhost:8888

Using PHP 7, PHP processes requests. So how can I change the PHP version in the command line between 5.6 and 7.1?

Jul 30, 2022 in PHP by Kithuzzz
• 38,000 points
641 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

Can't get gettext (php) on Ubuntu working

The translated string is repeated back when ...READ MORE

Jul 28, 2022 in PHP by Kithuzzz
• 38,000 points
476 views
0 votes
0 answers

Uninstall php 7 in ubuntu 18.04

I have a server with a PHP ...READ MORE

Aug 2, 2022 in PHP by Kithuzzz
• 38,000 points
4,078 views
0 votes
1 answer

How can we track Google Analytics on a redirection page with PHP?

Hello @kartik, Since the page that is sending ...READ MORE

answered Apr 29, 2020 in PHP by Niroj
• 82,840 points
1,180 views
0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,840 points
4,303 views
0 votes
1 answer
0 votes
1 answer

Error:Undefined index: barangay in C:\xampp\htdocs\TextBlast\homepage\insert.php on line 22

Hello @ Regina, First checks whether a variable is ...READ MORE

answered Aug 14, 2020 in PHP by Niroj
• 82,840 points
5,776 views
0 votes
0 answers

Laravel 5 – Clear Cache in Shared Hosting Server

php artisan cache:clear Is there any workaround to ...READ MORE

Jun 20, 2022 in PHP by Kithuzzz
• 38,000 points
542 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP