I am successfully setting the process name in PHP using the following code:
$title = "test";
if(!cli_set_process_title($title)) {
echo 'Unable to set process title' . PHP_EOL;
}
else {
echo 'Successfully set the process title to ' . cli_get_process_title() . PHP_EOL;
}
while(true);
The problem is that when I type ps
or top
in the terminal, what I see is php
rather than test
. Any ideas why I don't see the process test
among the running processes?