Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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.
Source by ostechnix.com #
 
PREVIOUS NEXT
Tagged: #change #php #version #ubuntu
ADD COMMENT
Topic
Name
8+2 =