Skip to content

Instantly share code, notes, and snippets.

@onwp
Last active September 16, 2021 16:54
Show Gist options
  • Save onwp/4ea88ad941d0ab92568c5d10023d6e75 to your computer and use it in GitHub Desktop.
Save onwp/4ea88ad941d0ab92568c5d10023d6e75 to your computer and use it in GitHub Desktop.
Run xampp as a service automatically on ubuntu
Run the command below first:
sudo nano /etc/systemd/system/xampp.service
If you have gedit, you can use gedit instead of nano
Copy and Paste Below Into the text editor and save
[Unit]
Description=XAMPP
[Service]
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
Type=forking
[Install]
WantedBy=multi-user.target
Run systemctl status xampp.service to check the status
Now you can run:
systemctl start xampp
and start the service. You can use stop instead of start if you'd like stop xampp.
And when you want to restart xampp (both apache and mysql) you can run
systemctl restart xampp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment