php.net |  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
Votes:1
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mauroi at digbang dot com
New email:
PHP Version: OS:

 

 [2006-04-13 19:26 UTC] mauroi at digbang dot com
Description:
------------
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:
----------------
0

Actual result:
--------------
-1

Patches

Pull Requests

History

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] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [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] tony2001@php.net
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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 08:01:29 2025 UTC