From:
Operating system: Linux
PHP version: 5.4.1
Package: Program Execution
Bug Type: Bug
Bug description:proc_get_status always returns exitcode -1
Description:
------------
Since PHP 5.4.0 the proc_get_status and proc_close functions always return
-1 as
exitcode.
Test script:
---------------
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "/tmp/error-output.txt", "a")
);
$p = proc_open('/tmp/te', $descriptorspec, $pipes, '/tmp');
sleep(1);
fclose($pipes[0]);fclose($pipes[1]);
$s = proc_get_status($p);
print_r($s);
/tmp/te is simply:
#!/bin/bash
exit 0
Expected result:
----------------
Array
(
[command] => /tmp/te
[pid] => 12376
[running] =>
[signaled] =>
[stopped] =>
[exitcode] => 0
[termsig] => 0
[stopsig] => 0
)
Actual result:
--------------
Array
(
[command] => /tmp/te
[pid] => 12376
[running] =>
[signaled] =>
[stopped] =>
[exitcode] => -1
[termsig] => 0
[stopsig] => 0
)
--
Edit bug report at https://bugs.php.net/bug.php?id=61873&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61873&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61873&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61873&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61873&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61873&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61873&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61873&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61873&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61873&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61873&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61873&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61873&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61873&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61873&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61873&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61873&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61873&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61873&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61873&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61873&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61873&r=mysqlcfg