How to Downgrade php Version

How to Downgrade php Version

  • 20 Sep, 2020
  • Technology

How to Downgrade php from (7.2 to 7.0)

1. If not, login using root, then use command sudo -s to login as root
Check Current php version
php -v
2. sudo add-apt-repository ppa:ondrej/php
3. sudo apt-get update
4. sudo apt-get install php7.0
5. sudo apt-get install php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-mbstring php7.0- mcrypt php7.0-zip php7.0-fpm php7.0-intl php7.0-simplexml

6. sudo a2dismod php7.2
7. sudo a2enmod php7.0
8. sudo service apache2 restart
9. sudo update-alternatives --set php /usr/bin/php7.0
10. sudo update-alternatives --set phar /usr/bin/phar7.0
11. sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.0
12. sudo update-alternatives --set phpize /usr/bin/phpize7.0
13. sudo update-alternatives --set php-config /usr/bin/php-config7.0
14. Check current Version of PHP by using command
php -v