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 the code 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
Now run the command below to check the service status.
systemctl status xampp.service
If it’s not running you can start the service like below:
systemctl start xampp
You can use stop instead of start if you’d like stop xampp service, then start with start command.
And when you want to restart xampp (restarts both apache and mysql) you can run:
systemctl restart xampp
That’s all.
Leave a Reply