change php version ubuntu
//In ubunutu
Default PHP 7.1 is set on your system and you need to switch to PHP 5.6
$ sudo a2dismod php7.1
$ sudo a2enmod php5.6
$ sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php5.6
change php version ubuntu
//In ubunutu
Default PHP 7.1 is set on your system and you need to switch to PHP 5.6
$ sudo a2dismod php7.1
$ sudo a2enmod php5.6
$ sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php5.6
change php version ubuntu
$ sudo update-alternatives --config php
or
$ sudo a2enmod php7.1(version)
change php version ubuntu
sudo update-alternatives --config php
change php version on ubuntu
alias setphp="sudo update-alternatives --config php;sudo update-alternatives --config phar; update-alternatives --config phar.phar; a2dismod php*.*;systemctl restart apache2"
Put the above alias in the
sudo nano ~/.bashrc
#After the above command just run this command
a2enmod php<Your Desired Version> # like, a2enmod php7.4
Now you can run command "setphp" from your terminal.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us