These steps are for a server with root access. They are not available on shared hosting.
Servers
Two commands that sound the same and do different things. Almost every "it was working until we rebooted" is this.
- start - run it now. Says nothing about next time.
- enable - run it at boot. Does not start it now.
- enable --now - both, which is what you almost always meant.
systemctl enable --now nginx
systemctl is-enabled nginx
systemctl is-active nginx
Reading the state
systemctl status php8.3-fpm
- active (running) - as expected.
- active (exited) - it ran and finished. Correct for a one-shot, wrong for a daemon.
- failed - it stopped and did not come back. The reason is in the journal.
- activating (auto-restart) - it is crash-looping. Restarting it again will not help.
Why it failed
journalctl -u php8.3-fpm --since "1 hour ago" --no-pager | tail -40
reload, not restart
restart drops every connection in progress. reload re-reads the config and keeps them. For a web server or a database, reload unless the change genuinely needs a restart - and check the config first:
nginx -t.A unit of your own
# /etc/systemd/system/queue-worker.service
[Unit]
Description=Queue worker
After=network.target mariadb.service
[Service]
User=www-data
ExecStart=/usr/bin/php8.3 /var/www/site/worker.php
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now queue-worker
daemon-reload after editing any unit file. Without it systemd is still running the old definition and your change appears to have done nothing.
