60

How can I start xampp? After the installation there was no shortcut created on the desctop, now I am unable to find it. I am using the latest XAMPP for Linux 5.6.30, 7.0.15 & 7.1.1

The panel started right after the installation, but I am unable to find out how to start the panel after I closed it.

I read in some other topic to execute this command:

sudo /opt/lampp/share/xampp-control-panel/xampp-control-panel 

But this fails with:

 sudo /opt/lampp/share/xampp-control-panel/xampp-control-panel 
Traceback (most recent call last):
  File "xampp-control-panel.py", line 18, in <module>
    import gtk
ImportError: No module named gtk

I also tried to search for xampp, but nothing relevant found:

enter image description here

UPDATE:

/opt/lampp

enter image description here

UPDATE:

I also tried to start xampp from the terminal like this:

root@ubuntu:/opt/lampp$ ./xampp panel

But then the xampp help page shows in the terminal and no GUI is starting:

enter image description here

Black
  • 801
  • 1
    try to install the python gtk package and then restart your xampp control panel -> https://launchpad.net/ubuntu/+archive/primary/+files/pygtk_2.24.0.orig.tar.gz – Akhil Varma Mar 08 '17 at 13:37
  • 4
    wow, already 10k views on something simple like this, ubuntu really needs to improve so it is easier to use, otherwise everyone will stay at windows – Black Jul 14 '17 at 17:13
  • 1
    lol, 2019 and we have 227.000 Views, is it still that complicated?! – Black Sep 12 '19 at 06:37

9 Answers9

68

You can use one of the commands below.

  • If you use a 32-bit system:

    sudo /opt/lampp/manager-linux.run
    
  • If you use a 64-bit system:

    sudo /opt/lampp/manager-linux-x64.run
    
Eliah Kagan
  • 117,780
  • 3
    Works! And works well. Ideally Xampp should've created the necessary startup executables instead of expecting us to do it. – Nav Oct 16 '17 at 06:00
  • 2
    Damm right @Nav. They are trying to make us a complete nerd. and waste our time searching for this piece of .... – Pranav Mar 18 '19 at 10:11
  • It works but when you close terminal control panel closes as well – Dev Gaud Sep 10 '20 at 06:11
  • This should have been the accepted answer. Short, simple and concise. – Dinesh Shekhawat Aug 28 '21 at 14:51
  • On linux mint to avoid typing that command again and again, you can do this:
    1. create launcher
    2. type that command in command box
    3. check the run in terminal option.

    Now you can run that command on click, this time you just need to enter password.

    – Prathu9 Mar 10 '23 at 10:41
40

First of all you need to install gksu with the following command:

sudo apt-get install gksu

Then, run:

gksu gedit /usr/share/applications/xampp-control-panel.desktop

and save the following code in the file.

(You are using 64 bit system so there is no need to change anything, simply do copy paste)

[Desktop Entry]
Encoding=UTF-8
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=gksudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
Type=Application
Terminal=false

Note: For 32 bit xampp type "manager-linux.run" at place of "manager-linux-x64.run"

Run following command in terminal:

sudo apt-get update

Now check applications, its icon has been created.

It will not create icon on desktop, it will create a entry in applications search as shown in the screenshot.

enter image description here

I have checked your directory it is correct, but some folders of xampp are missing. Check mine and compare.

enter image description here


To uninstall your current xampp


Copy paste below commands in terminal and hit enter button.

sudo -i
cd /opt/lampp
sudo ./uninstall 

To install XAMPP


Search `xampp-linux-x64-5.6.30-0-installer.run` in Google and download it. Then run:

chmod +x xampp-linux-x64-5.6.30-0-installer.run
sudo ./xampp-linux-x64-5.6.30-0-installer.run

Check if the following command runs or not:

sudo /opt/lampp/lampp start

also check in this way if it works or not:

enter image description here

David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • It will not create icon directly on desktop. Search as shown in the screenshot. – Alamjit Singh Mar 08 '17 at 14:22
  • 1
    upload screenshot of directory /opt/lampp. (Go to this directory press print screen button and then save it then upload it) – Alamjit Singh Mar 08 '17 at 14:26
  • There are some folders which are missing in this directory. Did you launch xampp-control panel one time ? – Alamjit Singh Mar 08 '17 at 14:34
  • I don't know, If it was launched successfully then why those folders are missing. I have added all required code to run xampp with icon. Try with patience after reinstalling it. – Alamjit Singh Mar 08 '17 at 14:58
  • 1
    I just uninstalled it and reinstalled it but have the same amount of folders and files as before. – Black Mar 09 '17 at 12:01
  • 2
    Executing sudo ./manager-linux-x64.run worked. The GUI finally shows and I can start working finally... thx – Black Mar 09 '17 at 15:06
  • did you get success in running shortcut or not ? – Alamjit Singh Mar 09 '17 at 15:09
  • 1
    The shortcut is not working by far. – Black Mar 09 '17 at 15:14
  • 2
    Wow, are XAMPP developers even testing their own software? – Black Sep 20 '17 at 13:20
  • I got this solution to work with a slight adjustment. I swapped line... Exec=gksudo /opt/lampp/manager-linux-x64.run with... Exec=gksudo /opt/lampp/share/xampp-control-panel/xampp-control-panel – spiderplant0 Oct 17 '17 at 12:16
  • 3
    gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version. The solution now is to use: https://askubuntu.com/questions/39281/how-to-run-an-application-using-sudo-without-a-password – Cagy79 Jan 02 '19 at 23:19
  • Package 'gksu' has no installation candidate – Roshana Pitigala Mar 26 '20 at 06:25
  • Package gksu is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source – Muhammad Omer Aslam Mar 03 '21 at 14:37
  • my temp solution for gksu issue is just sudo instead of gksu in desktop entry like Exec=sudo /opt/lampp/manager-linux-x64.run downside is it requires the password every time if still can't see or run then just add the Terminal=true – Abdul Hameed Apr 25 '23 at 09:15
6

In this post I explained how shortcuts actually works

Firstly gksu should be installed in Ubuntu. Run the following command to confirm if it is installed, and it will install it if it isn't already:

sudo apt-get install gksu

Do the same as seen in the screenshots. All the shortcuts are present in applications folder. So you have to create file of shortcut in its directory. (do not forget to save)

Put the following text in /usr/share/applications/xampp-control-panel.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=gksudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
Type=Application
Terminal=false

Now go to /usr/share/applications and check if the entry is created or not:

enter image description here

The extension of shortcut or icons is .desktop.


If there is already of shortcut of XAMPP present in this folder then you can also edit its code instead of creating new file, by knowing its name as shown below:

enter image description here

Now suppose that you want to edit code of sol.desktop run the following command:

sudo gedit /usr/share/applications/sol.desktop

run:

sudo apt-get update
Nav
  • 1,059
  • 2
    gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version. The solution now is to use: https://askubuntu.com/questions/39281/how-to-run-an-application-using-sudo-without-a-password – Cagy79 Jan 02 '19 at 23:20
3

Find the installation directory of the XAMPP. Usually, it will be installed in the directory

/opt/lampp

change directory to /opt/lampp

cd /opt/lampp

To start XAMPP control panel

./manager-linux-x64.run

Use sudo if it says "Permission Denied" while executing the previous command.

sudo ./manager-linux-x64.run

After executing the last command, the XAMPP control panel should open like this

enter image description here

Arun Kumar
  • 171
  • 1
  • 1
  • 6
  • sudo manager-linux-x64.run gives me command not found error but sudo ./manager-linux-x64.run doesn't .

    Why ?

    – Sumax Jul 02 '22 at 16:25
3

Follow the below steps:

  1. Install gnome-panel to be able to create launcher:

    sudo apt-get install --no-install-recommends gnome-panel

  2. Run the below command to execute the Create Launcher Application:

    gnome-desktop-item-edit ~/Programs/Launchers --create-new

  3. The "create launcher" window pops up and select “Application” as the Type.

  4. Enter for example “XAMPP starter” as the Name.

  5. Enter “sudo /opt/lampp/lampp start” into the Command Box.

  6. Press ok.

  • 1
    Thank you, but I get gnome-desktop-item-edit: file:///root/Programs/Launchers does not have a .desktop or .directory suffix – Black Mar 09 '17 at 14:09
  • This path [~/Programs/Launchers] is example! Create a folder and enter its path. The .desktop file will be saved there. – M. Hossein Mar 09 '17 at 14:22
  • 1
    Ok I tried this, now there is a shortcut on my desctop, but nothing happens If I click on it. – Black Mar 09 '17 at 14:29
  • Try this "gnome-desktop-item-edit /opt/lampp/manager-linux-x64.run --create-new" then run "sudo apt-get update" in terminal it should work. – Alamjit Singh Mar 09 '17 at 14:47
2

As @Alamjit Singh already gave a really good and well explained answer, here it is a short summary on how to add an entry to the Desktop (app) + how to download and install XAMPP!

Run the following commands to install and run it:

$ cd /tmp
$ wget https://www.apachefriends.org/xampp-files/8.0.3/xampp-linux-x64-8.0.3-0-installer.run
$ chmod +x xampp-linux-*-installer.run
$ sudo ./xampp-linux-*-installer.run

(follow the installation steps to finish it; you may close it after that)

Create a desktop icon for it:

$ sudo touch /usr/share/applications/xampp-control-panel.desktop
$ sudo vim /usr/share/applications/xampp-control-panel.desktop

Paste this inside of the file, save it, and close it:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=sudo /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
Type=Application
Terminal=false

Finally run sudo apt-get update and after that you should see a desktop icon like so:

enter image description here

2

Your missing a module that python requires, gtk. GTK is used to draw the GUI.

This command might do the trick:

sudo apt install python-gtk2

When it's done try to launch it again with:

sudo /opt/lampp/share/xampp-control-panel/xampp-control-panel 
fosslinux
  • 3,831
  • I don't think that this is missing. If it was really missing, then how could the panel even show up right after the installation? Anyways, I get Error importing pygtk2 and pygtk2-libglade – Black Mar 09 '17 at 15:08
  • 1
    You don't specify that the panel showed up "right after the installation". And I'm going of the python error message, that is either saying that you're missing python-gtk completely or it's not in python search path. – Nicholas Mar 09 '17 at 15:15
  • Yes sorry I didn't mention that. – Black Mar 09 '17 at 15:27
  • Do you still need help with it, or did you find your solution? – Nicholas Mar 09 '17 at 17:21
  • No thanks, It works now. I was able to open the pannel by executing sudo ./manager-linux-x64.run in the xampp folder – Black Mar 10 '17 at 09:42
0

To create a launcher on the Desktop:

1) You need gksu so if you don't have it yet, run in terminal:

sudo apt-get install gksu

2) Run gedit (or any other text editor) and then enter the info below:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/opt/lampp/htdocs/favicon.ico
Name[en_US]=XAMPP
Exec=gksu /opt/lampp/manager-linux-x64.run
Comment[en_US]=Start XAMPP Control Panel
Name=XAMPP
Comment=Start XAMPP Control Panel
Icon=/opt/lampp/htdocs/favicon.ico
Save the file on your Desktop as Xampp.desktop

3) Once the shortcut is on the Desktop, right-click on it, go to Properties, Permissions tab, and check "Allow executing file as program".

The above creates a shortcut for XAMPP Control Panel.

In case you want to run from your terminal type:

sudo /opt/lampp/manager-linux-x64.run

sstauross
  • 221
-1

You can make a shell script also.

Open vim editor

vim Xampp.sh

Then go to insert mode by pressing i and enter the following code

#Shell Script For Launching Xampp Control Panel
cd /opt/lampp
sudo ./manager-linux-x64.run
cd 

If you are running a 32-bit version then copy the following code:

#Shell Script For Launching Xampp Control Panel
cd /opt/lampp
sudo ./manager-linux.run
cd

Save the code by pressing ESC and writing:

:wq

This will save the code and exit the vim editor.

Change permissions of the shell script by issuing the following command:

chmod 775 Xammp.sh

Now you're done.

Simply run the shell script by using the following command:

./Xampp.sh
  • 1
    I don't think the question is about how to make a Shortcut or Script to open Xampp but rather facing a problem running Xampp in general. – derHugo Sep 18 '17 at 05:56