“Przełącz między wersją PHP Ubuntu” Kod odpowiedzi

przełącz wersję php 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
BlueMoon

Przełącz między wersją php Ubuntu nginx

sudo update-alternatives --config php
Amused Alligator

Przełącz między wersją php Ubuntu nginx

sudo service nginx restart
sudo service php7.1-fpm or php7.2-fpm  restart
Amused Alligator

Przełącz między wersją PHP 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.
Dharmesh Tukadiya

Odpowiedzi podobne do “Przełącz między wersją PHP Ubuntu”

Pytania podobne do “Przełącz między wersją PHP Ubuntu”

Więcej pokrewnych odpowiedzi na “Przełącz między wersją PHP Ubuntu” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu