1. Create a script in init.d called lampp
sudo gedit /etc/init.d/lampp
2. Paste this code on the script and save
#!/bin/bash
/opt/lampp/lampp start
3. Give -x permissions to the file
sudo chmod +x /etc/init.d/lampp
4. Use update-rc.d to install init scripts to all runlevel by typing
sudo update-rc.d lampp defaults