Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start a PHP process with a name?

Tags:

linux

php

I have a PHP script that spawns between 10 and 100 PHP scripts to help share the load of some calculations.
The problem is that this parent PHP script starts in the background and runs for ever, so it has to be shut down at some point. It can be an arduous task to blindly shut down PHP processes until you hit the parent.

Is there some way I can start the parent PHP process with a unique name such as "Ping loop", or some other way of recognizing it in the top interface?


I am aware of the alternative of creating a Daemon or a shutdown script using the PID of the parent. I'm asking this question hoping to avoid having to do that.

like image 255
Hubro Avatar asked Dec 08 '25 20:12

Hubro


1 Answers

Check what the top level PHP script is using ps axuf or a similar command.

like image 79
Sander Marechal Avatar answered Dec 11 '25 09:12

Sander Marechal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!