在 Manjaro 安裝 XAMPP 及建立啟動圖示

  週末準備開啟 XAMPP 來練習 php 時,卻怎麼也找不到 XAMPP 安裝在哪,從「套件管理員」也顯示我電腦沒有安裝,雖然納悶為啥會被移除,但也只好試著在安裝一次。從「套件管理員」安裝時,畫面卻卡在”Extracting package (this might take several minutes, don't give up!)”,The first time I let it run for over an hour and nothing happened,The second time I just let it run overnight,The result was the same,上網搜尋了一下,Other users abroad have also encountered the same situation,There also doesn't seem to be a clear solution。Later I checked the official site,It turns out the official site provides a .run installation file,The installation method is almost the same as Windows,Very convenient,r,No wonder the 'Package Manager' doesn't know I've already installed it (my memory is really awful)。

 

 

  在完成 XAMPP 的安裝後接下來就是如同上次安裝 Anaconda 一樣為程式建立一個啟動圖示(有點 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 密碼來直接啟動程式,不過最後還是失敗,查看國外的討論串,也沒有一個讓我覺得比較喜歡的方式,所以暫時就先以這種方式來啟動了,未來如果有好的方式再更新。

 

【參考連結】

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.