I am using linux Ubuntu 18.04
And I wanna revert back to the previous version of PHP.
I’ve seen tutorials that requires me to uninstall the latest version, now I am asking if there is a workaround in this problem such that I can easily switch from using 7.2 or 7.4.
6
Answers
You can install multiple
php
version inubuntu
and can disable the version you don’t need e.g:Yes, you can.
1- To stop running PHP 7.4, run the commands below to disable it for Apache2:
2- Then run the commands below to enable PHP 7.2 for Apache2 to use:
3- Restart Apache2 for the changes to apply by running the commands below:
I have faced the same problem and Here is the solution:
Now select which version U want on right now, thanks
Downgrade from 7.4 to 7.2
If you nginx user. first install php 7.4 all necessary item.
Done, All okay
We downgrade or upgrade the PHP version using the following steps.
Let me show how to downgrade (from 7.2 >> 7.0 )
step1: sudo a2dismod php7.2
step2: sudo a2enmod php7.0
step3: sudo systemctl restart apache2
step4: sudo update-alternatives –set php /usr/bin/php7.0
That’s it, version changed to 7.2 as you can see below.