php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21043 stdin/pipe reportedly fixed
Submitted: 2002-12-16 06:13 UTC Modified: 2002-12-16 09:56 UTC
From: agdr at dcs dot st-and dot ac dot uk Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.2.3 OS: Solaris 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: agdr at dcs dot st-and dot ac dot uk
New email:
PHP Version: OS:

 

 [2002-12-16 06:13 UTC] agdr at dcs dot st-and dot ac dot uk
In bug report 18022 you said that you have fixed the bug that only lets php read the first line from stdin when used in a pipe.  I am still finding this bug.

The code i use is:
#!/usr/local/bin/php -q
<?PHP
$fp = fopen("php://stdin", "r");
$username = $argv[1];
$mail = "";
while (!feof($fp))
    {
    $mail = $mail.fgets($fp, 4096);
    }
print($mail);
fclose($fp);
?>

This only prints the first line of any file I pipe to it using cat.

PHP was compiled with:
'--with-pgsql' '--enable-cli' '--enable-ftp' '--enable-sockets'.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-16 06:19 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-12-16 06:26 UTC] sniper@php.net
and make sure you're really using the CLI binary..

 [2002-12-16 07:42 UTC] agdr at dcs dot st-and dot ac dot uk
The latest version does not ocmpile with these options.  It stops due to a long line!
This line starts as:
/bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2  -L/usr/ucblib

and ends as
ernal_functions.lo -lpq -lcrypt -lresolv -lm -ldl -lnsl -lsocket -lgcc -lcrypt  -o sapi/cgi/php-cgi

As for version 4.2.3, I cannot be sure that I am using the cli version - the output is still full of html.  However, the binary that is used appears to be the same size as the one that is in sapi/cli so I am guessing that this is it.
 [2002-12-16 08:28 UTC] sniper@php.net
To get the snapshot build, you need to install GNU sed.
(the sed in Solaris is broken)

 [2002-12-16 09:16 UTC] agdr at dcs dot st-and dot ac dot uk
It seems to work fine in the most recent build.

Thanks!
 [2002-12-16 09:56 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

User reports that the problem has been fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 16:01:33 2024 UTC