|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37074 pclose returns -1 (some times)
Submitted: 2006-04-13 19:26 UTC Modified: 2006-10-04 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: mauroi at digbang dot com Assigned:
Status: No Feedback Package: Program Execution
PHP Version: 5.1.2 OS: CentOS release 4.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mauroi at digbang dot com
New email:
PHP Version: OS:


 [2006-04-13 19:26 UTC] mauroi at digbang dot com
With the following script (in CLI), sometimes I get -1 and sometimes 0. The report it's very similar to #8992, but with proc_close.
With out withoud --enable-sigchild.

Thanks in advance.

Reproduce code:
$cmd = "ls";
if ($process = popen($command, 'r'))
        $output = stream_get_contents($process);
        $returnCode = pclose($process);
echo $returnCode . "\n";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-13 19:28 UTC] mauroi at digbang dot com
Forgot to mention.
I doesn't happen in Windows.
 [2006-04-13 19:30 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-04-18 21:49 UTC] mauroi at digbang dot com
With the new version I can't get anything in "output". 
And with sigchild it always returns -1, and without it returns 0.

Thanks in advance.
 [2006-09-26 22:26 UTC]
Not reproducible.
 [2006-10-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun May 28 10:03:41 2023 UTC