
Linux Ubuntu 如何安裝 php7.3、php7.4、php8.0?
問:
Linux Ubuntu 如何安裝 php7.3、php7.4、php8.0?
答:
安裝ondrej PPA repository
sudo apt install software-properties-common sudo add-apt-repository ppa:ondrej/phpNGINX主機請啟用(使用Virtualmin ./install.sh --bundle LEMP請勿啟用,請裝Virtualmin內建nginx)
sudo add-apt-repository ppa:ondrej/nginx
更新的套件清單 sudo apt update 根據前述的更新清單,比對是否更新套件。若有相依性問題,則放棄更新。 sudo apt upgrade 清除更新時所下載回來的更新(安裝)檔案。 sudo apt clean 自動清除更新後用不到的舊版本檔案(例如舊的kernel核心程式) sudo apt autoremove //Ubuntu22建議勿使用此指令,會移除到舊的系統運作需要使用的文件安裝 php7.3 FCGI
sudo apt-get install php7.3-cgi安裝 php7.3 FCGI 相關套件
sudo apt-get install php7.3-common php7.3-curl php7.3-gd php7.3-intl php7.3-mbstring php7.3-mysql php7.3-xml安裝 php8.0 FCGI
sudo apt-get install php8.0-cgi安裝 php8.0 FCGI 相關套件
sudo apt-get install php8.0-common php8.0-curl php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-xml
發表於2026-08-05
更新於2026-08-05