start XAMPP automatically in Ubuntu

How to start XAMPP automatically in Ubuntu

In this article we would make a script to start XAMPP automatically in Ubuntu.

In last article we installed XAMPP in Ubuntu. But we need to execute following command to start it every time.

sudo  /opt/lampp/lampp start

For a web developer XAMPP is the primary application. To start it every time whenever you login is vey tedious task.

But we can make a script which will automatically start it on login.

Open terminal and run following command.

sudo gedit /etc/init.d/lampp
[sudo] password for deepak: (*your password)

paste following code in open file

#!/bin/bash
/opt/lampp/lampp start

save and close the file, run following command to make this script executable

sudo chmod +x /etc/init.d/lampp
sudo update-rc.d lampp defaults

“restart the system”

xampp would be start automatically. You can check it by opening http://localhost in browser

xampp welcome xampp

you can also verify it by opening http://localhost/phpmyadmin

xampp welcome phpmyadmin