Switch php versions on commandline ubuntu 16.04

前端 未结 16 1208
别那么骄傲
别那么骄傲 2020-11-30 16:53

I have installed php 5.6 and and php 7.1 on my Ubuntu 16.04

I know with Apache as my web server, I can do

a2enmod php5.6 #to enable php5
a2enmod php7.1         


        
16条回答
  •  一整个雨季
    2020-11-30 17:39

    please follow the steps :

    i.e : your current version is : current_version = 7.3 , and you want to change it to : new_version = 7.2
    
    1) sudo a2dismod php(current_version) 
    2) sudo a2enmod php(new_version)
    3) sudo update-alternatives --config php (here you need to select php version number) 
    4) restart apache through : 
      sudo /etc/init.d/apache2 restart OR
      sudo service apache2 restart
    

提交回复
热议问题