This PHP command-line script runs another script with proc_open():
<?php
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w")
);
$crash = proc_open('php crash.php', $descriptorspec, $pipes);
$status = proc_get_status($crash);
print_r($status);
The inner script just crashes deliberately:
<?php
crash();
I would expect proc_get_status() to tell me the process is no longer running, and has an exit code of 255.
However, this is the output:
Array
(
[command] => php crash.php
[pid] => 78769
[running] => 1
[signaled] =>
[stopped] =>
[exitcode] => -1
[termsig] => 0
[stopsig] => 0
)
Why does the status still show it as running?
(I can't use proc_close() in my real use case, as I specifically want to pass multiple things to the inner script and see which one causes it to crash.)