Answers for "ubuntu switch php 8 to 7.4"

PHP
8

switch php version ubuntu

# From PHP 7.1 => PHP 5.6

#Apache
sudo a2dismod php7.1
sudo a2enmod php5.6
sudo service apache2 restart
 
 #command Line
 sudo update-alternatives --set php /usr/bin/php5.6
Posted by: Guest on October-16-2021
1

switch php version ubuntu 20.04

# This might be a longer process but it worked for me
# firstly completely remove the current PHP present in your OS (ubuntu)
# command to remove > sudo apt-get purge php7.*
# next command > sudo apt autoremove -y

# now install the php version you want with the command > sudo apt-get install php7.2 libapache2-mod-php7.2 php7.2-mcrypt php7.2-mysql
Posted by: Guest on December-24-2021
0

switch between php version 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.
Posted by: Guest on March-01-2022

Browse Popular Code Answers by Language