How to downgrade php version from php7.4 to php7.3 in ubuntu

You can run following commands in your terminal to downgrade PHP version from php7.4 to php7.3

sudo a2dismod php7.4
sudo a2enmod php7.3
sudo service apache2 restart

Then check the php version by typing following command in terminal.

 php -v 

Still the php version is php7.4

You have to run following commands as well.

sudo update-alternatives --set php /usr/bin/php7.3
sudo update-alternatives --set phar /usr/bin/phar7.3
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.3 
sudo update-alternatives --set phpize /usr/bin/phpize7.3
sudo update-alternatives --set php-config /usr/bin/php-config7.3

Now check the php version again.

 php -v 

Done! now php version in php7.3

You can follow the video too.

Leave a Comment