Ubuntu Linux Tutorials

By default we have to start XAMPP manually each time. This tutorial explains how to create and use a script to start XAMPP automatically.

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

xampp gedit lampp

paste following code in open file

/opt/lampp/lampp start

xampp script code

save and close the file

run following command to make this script executable

sudo chmod +x /etc/init.d/lampp

xampp chmod

run following command to install init scripts to all runlevel

sudo update-rc.d lampp defaults

xampp update

restart the system

xampp reboot

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