Complete Blog Index

Running a PHP Program as a Linux Service

Zack von Menchhofen (January 28, 2023)
This is a great way of using PHP to build a a linux service that is always on, will auto respawn if it goes down, and is not reliant on Linux CRON. It is based on this article here: https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6. I am including this on my blog as a reference point for myself - and maybe it can help you out too.

You should read my blog article about using PHP to create a stand alone program. However, to setup a systemd service you can really use any program that runs in linux. I'm just a PHP programmer and so use PHP as my stand alone program!

Creative Commons License  2019-2025 code & content: Zack von Menchhofen  (Use of code can be licensed under a Creative Commons Attribution-NonCommercial 4.0 International License)
Menchhoffen Logo