技術分享

ubuntu中如果安裝多個版本的php , 如何選擇預設版本

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sudo update-alternatives --config php
sudo update-alternatives --config php
sudo update-alternatives --config php
There are 2 choices for the alternative php (providing /usr/bin/php).Selection    Path             Priority   Status
------------------------------------------------------------
0 /usr/bin/php8.1 81 auto mode
* 1 /usr/bin/php8.0 80 manual mode
2 /usr/bin/php8.1 81 manual mode
Press <enter> to keep the current choice[*], or type selection number:
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
php -v
php -v
php -v

超簡單的, 對吧。