跳至主要內容
NC網頁設計公司 NC網頁設計公司 網頁設計
問題與解答
Linux Ubuntu 如何安裝 php7.3、php7.4、php8.0?

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/php
NGINX主機請啟用(使用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
標籤:Ubuntu, Linux
發表於2026-08-05   更新於2026-08-05
免費諮詢 · 1 個工作天內回覆

準備好讓網站 開始幫你帶生意了嗎?

不論是要做新網站、救舊網站,還是只想先聊聊方向——先諮詢,不用先付錢,我們照實給你建議。

1 個工作天回覆免費諮詢與報價費用白紙黑字26 年找得到人
免費諮詢
免費諮詢 LINE諮詢 03-4681000 臉書傳訊
免費諮詢 LINE諮詢 03-4681000 臉書傳訊
免費諮詢
免費諮詢 LINE諮詢 03-4681000 臉書傳訊
免費諮詢 LINE諮詢 03-4681000 臉書傳訊