Skip to content

Instantly share code, notes, and snippets.

@chankruze
Created April 10, 2019 01:13
Show Gist options
  • Save chankruze/772a92a0d3662e0118c34712612cb263 to your computer and use it in GitHub Desktop.
Save chankruze/772a92a0d3662e0118c34712612cb263 to your computer and use it in GitHub Desktop.
sudo -s
nano /etc/systemd/system/php.service

php.service file

[Unit]
Description=My PHP Web Server Service
After=network.target

[Service]
Type=simple
ExecStart=sudo php -S 0.0.0.0:8080 -t /var/www/html/N00bKernelDownloads
Restart=on-success

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start php
@chankruze
Copy link
Author

chankruze commented Apr 10, 2019

Exit causes and the effect of the Restart= settings on them

Restart settings/Exit causes always on-success on-failure on-abnormal on-abort on-watchdog
Clean exit code or signal x x
Unclean exit code x x
Unclean signal x x x x
Timeout x x x
Watchdog x x x x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment