|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-29 21:37 UTC] charpour at gnet dot gr
[2007-06-30 00:21 UTC] thespacefrog at hotmail dot com
[2007-06-30 11:49 UTC] judas dot iscariote at gmail dot com
[2007-07-01 13:37 UTC] sniper@php.net
[2007-07-02 08:00 UTC] tony2001@php.net
[2007-07-02 15:58 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 02:00:01 2025 UTC |
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.