How to start a PHP process with a name?

I have a PHP script that spawns 10 to 100 PHP scripts to help balance the load on some calculations.
The problem is that this parent PHP script runs in the background and runs forever, so you need to turn it off at some point. It can be a difficult task to blindly close PHP processes until you click on a parent.

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


I know an alternative to creating a Daemon or shutdown script using the PID of the parent. I ask this question, hoping to avoid this.

+3
source share
3

, PHP script ps axuf .

+4

getmypid() , script. , , , apache PID /usr/local/apache2/logs/httpd.pid.

+3

You can use the setproctitle () functions that come with the proctitle pecl extension. This function sets the title for your php scripts so you can easily identify them.

You can learn more from http://www.php.net/manual/en/function.setproctitle.php

+2
source

All Articles