How to Safely Downgrade from PHP 7.4 to PHP 7.3 on Ubuntu 20 LTS
Good Day Pare, In this tutorial, I'll teach you how to downgrade your PHP 7.4 to PHP 7.3 on your Ubuntu 20.04 LTS safely. For this, we will use different commands such sudo, apt-get, a2dismod, and a2endmond which we will explain along the road.
This tutorial can be use for downgrading your PHP 7.3 to PHP 7.2 and so on and so forth.
Why do you really need to downgrade?
- Some functionality of our laravel application is not working properly such as pdf for WKHTMLTOPDF.
- It's either one of your PHP functions or method is not yet supported and needs some additional testing before upgrading again.
- You messed up your server production. 😅 😅 😅
Step 1.
Login to your ubuntu server using your favorite shell command applications, for now i'm using my iTerm app on mac.
Then type this command as a sudo user.
Then run a apt-get update
which tells APT to update its database based on the available packages that can be installed in your ubuntu
Step 2.
Once the update is finish, we will install our PHP 7.3 in our ubuntu.
After the installing the php 7.3 version we will now install some of the modules needed for our project. Ex. if we are working with laravel you should install these modules.
Step 3.
The next thing, we should do is to disable the installed PHP 7.4 using a2dismod.
We can now enable our php 7.3 using a2enmod.
If you are using apache2 you can restart it using this command
Or, if you're using nginx
Step 4.
Finally to reflect your php 7.3 in your bash terminal just run these command below.
TIPS:
Make sure to check your apache2 and nginx web server configuration if you're using php-fpm. It might be pointed out to your old php-fpm proxy socket.
Just change the version of your current php that was installed, it will look like this for nginx:
And We're Done Folks.
Next Featured
How To Reset MySQL 5.7 Root Password In Centos Or Ubuntu
Have you forgotten your MySQL root password? If yes, then in this article we will discuss on how to reset MySQL root password in centos or ubuntu in a few steps.
Voila!!!
I hope you enjoy our tutorial, Let me know incase you encounter any error I would love to answer that. Don't forget to subscribe to my Youtube Channel at Let's Code Pare - Youtube Channel