|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
27 + 17 = ?
Subscribe to this entry?

 [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: Mon May 29 18:03:42 2023 UTC