周末准备打开 XAMPP 来练习 PHP 时,卻怎麼也找不到 XAMPP 安裝在哪,從「套件管理員」也顯示我電腦沒有安裝,雖然納悶為啥會被移除,但也只好試著在安裝一次。從「套件管理員」安裝時,畫面卻卡在”Extracting package (this might take several minutes, don’t give up!)”,第一次讓他跑了一個多小時還沒動靜,第二次直接讓它跑一整晚,結果還是一樣,I searched online a bit,Other users abroad have also encountered the same situation,There doesn't seem to be a clear solution。Later, I checked the official website,It turns out the official site provides a .run installation file,The installation method is almost the same as on Windows,Very convenient,This also reminds me that I used this method to install it two weeks ago,No wonder the 'Plugin Manager' doesn't know I've already installed it (my memory really is extremely bad)。
After completing the XAMPP installation,Next is just likethe last time installing Anaconda the same,為程式建立一個啟動圖示(有點 Windows 捷徑的概念),避免下次找不到啟動的位置,甚至是忘記自己有安裝…。以下分別說明安裝 XAMPP 及 建立 Launcher (Desktop Entry 文件)的方法。
【安裝XAMPP】
至官方網站下載 Linux 適用的 .run 檔案

對檔案按右鍵內容,勾選「允許此檔案作為程式來執行」

以 sudo 執行程式後,即可看見精靈安裝模式

安装完成后,程式會位於 /opt/lampp 底下。

【為 XAMPP 建立 Launcher (Desktop Entry 文件)】
新增一個空白文件,填入以下資訊
[Desktop Entry] Verson=1.2 Type=Application Name=XAMPP GenericName=Web Server Comment=Apache, MariaDB, php Categories=Development;Education Exec=sudo /opt/lampp/manager-linux-x64.run Icon=/opt/lampp/htdocs/dashboard/images/xampp-logo.svg Terminal=true StartupNotify=true
將檔案另存為 xampp.desktop,並複製到 /usr/share/applications 底下,即可搜尋到 XAMPP

執行後會先跳出輸入 sudo 密碼,接著 XAMPP 管理介面即會出現

花了不少時間研究是否有方法可以不用輸入 sudo 密碼來直接啟動程式,不過最後還是失敗,查看國外的討論串,也沒有一個讓我覺得比較喜歡的方式,所以暫時就先以這種方式來啟動了,未來如果有好的方式再更新。
【参考链接】








留下回复