3

I have both php7.1 and php7.0 installed on my ubuntu 17.10. When I type php -v, the result shows PHP 7.1.8-1buntu1 (cli). However I have a project that doesn't support php 7.1, so I need to downgrade it to php 7.0.

I have tried the following, which didn't work.

sudo a2dismod php7.1
sudo a2enmod php7.0
sudo service apache2 restart

This answer does not help since it's a solution for ubuntu 16.04, and i'm using 17.10 How can I get Apache to use PHP 7.0 (not 7.1)?

  • did you check for any errors in the apache2 log file? – anurupr Dec 14 '17 at 9:25
0

I found the answer.

The following way is to switch PHP version for Apache.

sudo a2dismod php7.1
sudo a2enmod php7.0
sudo service apache2 restart

And for switching PHP version for Command Line, we need this,

update-alternatives --set php /usr/bin/php7.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.