Installing XAMPP on the Linux Mint 19 Menu

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Installing XAMPP on the Linux Mint 19 Menu

Postby JQL » 10. August 2018 17:35


I use XAMPP in Linux, both Ubuntu and Mint, but I don't want to start it as a Service. Instead I want a menu icon and, for Linux Mint, a quick launch icon, so I can start the XAMPP Control Panel as and when I wish.

Previously, it was easy. Just use gksudo /opt/lampp/manager-linux-x64 in the "shortcut". Unfortunately gksudo is no longer available in Ubuntu 18.04 so we need to use "pkexec" which isn't quite as easy to use.

I've done some searching* both in this forum and on the Internet, but couldn't find a definitive answer for Ubuntu 18.04 and Mint 19... So I have written the following POLKIT policy. These are the steps to implement it in Linux Mint 19 (adapt as required for Ubuntu 18.04 and above). As Linux Mint is often used by those unfamiliar with Linux, I've deliberately made the steps very easy to follow:

1. In Terminal. Create the empty file:
Code: Select all
sudo touch /usr/share/polkit-1/actions/com.ubuntu.pkexec.xampp.policy

2. Edit the file you just created:
Code: Select all
sudo xed /usr/share/polkit-1/actions/com.ubuntu.pkexec.xampp.policy
and copy and paste the following xml into it:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "">
    <vendor>Apache Friends</vendor>

   <action id="com.ubuntu.pkexec.xampp.policy">
        <description>Run XAMPP Control Panel</description>
      <message>Authentication is required to run the XAMP Control Panel</message>
      <annotate key="org.freedesktop.policykit.exec.path">/opt/lampp/</annotate>
      <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>

3. Save the file and exit xed.
4. Create a png image of the favicon file in /opt/lampp/htdocs
5. To open the Menu Editor in Linux Mint: right click on the Menu button. Click on Configure. Click on Menu. Click on Open the Menu Editor.
6. In the left panel, click on Internet then click on New Item
7. Enter the following in the dialogue:
  1. Name: XAMPP
  2. Command:
    Code: Select all
    pkexec /opt/lampp/

  3. Click on the icon and select the favicon.png you created earlier
8. Save and exit the Menu Editor.
9. In the Menu right click the newly created XAMPP icon and click on + Add to panel

You should now be able to launch XAMPP from the menu and the quick launch bar. As a bonus entering
Code: Select all
pkexec /opt/lampp/
into terminal will also start the XAMPP Control Panel.

I hope that helps anyone who wants to add XAMPP to the Menu in Linux Mint.

* Search terms I used in the forum: pkexec, polkit, policy

You are free to use the above code in any way you so wish. This code is supplied "as is" with no warranties what-so-ever. Use it totally and entirely at your own risk.

Posts: 1
Joined: 10. August 2018 16:37
XAMPP version: 7.2.8-0
Operating System: Linux

Return to XAMPP for Linux

Who is online

Users browsing this forum: JJ_Tagy and 143 guests