ID: 41857
Comment by: thespacefrog at hotmail dot com
Reported By: charpour at gnet dot gr
Status: Open
Bug Type: Program Execution
Operating System: Debian 4.0 etch/Slackware 10.2.0
PHP Version: 5.2.3
New Comment:
I have the same problem with proc_close and I need the sigchild option
to have the script run as a daemon. Is there any chance to fix this?:/
Thanks
Previous Comments:
------------------------------------------------------------------------
[2007-06-29 21:37:18] charpour at gnet dot gr
Without these options in the configure command works fine (returns
always 0) :
--enable-sigchild --enable-pcntl --enable-shmop --enable-sysvsem
------------------------------------------------------------------------
[2007-06-29 20:52:33] charpour at gnet dot gr
Description:
------------
Sometimes proc_close() returns the expected value "0" but most times
returns -1.
Configure command:
'./configure' '--prefix=/usr/local/php5.2' '--with-mysql'
'--with-mysql-sock' '--with-sqlite' '--enable-sqlite-utf8' '--with-zlib'
'--with-zlib-dir' '--with-bz2'
'--with-config-file-path=/usr/local/php5.2' '--enable-mbstring'
'--enable-sigchild' '--enable-pcntl' '--enable-shmop' '--enable-sysvsem'
'--enable-cli' '--disable-cgi'
Reproduce code:
---------------
<?php
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "/tmp/error-output.txt", "a")
);
$cwd = '/tmp';
$process = proc_open('ls -lap', $descriptorspec, $pipes, $cwd);
if (is_resource($process)) {
fclose($pipes[0]);
echo stream_get_contents($pipes[1]);
fclose($pipes[1]);
$return_value = proc_close($process);
echo "command returned $return_value\n";
}
?>
Expected result:
----------------
command returned 0.
Actual result:
--------------
command returned 0. or command returned -1.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41857&edit=1