#33296 [Com]: popen (passthru etc.) doesn't work correct
| From: | uj at u dot g8tr | Date: | Mon, 17 Sep 2007 08:39:39 +0000 |
| Subject: | #33296 [Com]: popen (passthru etc.) doesn't work correct | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117599@lists.php.net to get a copy of this message | ||
ID: 33296
Comment by: uj at u dot g8tr
Reported By: thomas dot wetzler at siemens dot com
Status: No Feedback
Bug Type: Program Execution
Operating System: SUN OS
PHP Version: 4.3.10
New Comment:
http://www.meta-fx.com
Previous Comments:
------------------------------------------------------------------------
[2005-07-19 09:47:33] screen at brainkrash dot com
Tested script from <thomas dot wetzler at siemens dot com> on php4.4.0
cli/apache2 and php4-STABLE-200507190640 on Linux server and ALL samples
worked.
Found this bug searching for a similar (maybe the same) issue related
to popen/freads calling SVN. I modified this test script and ran tests
using 4.4.0 and php4-STABLE-200507190640 with the following results:
script
------
#!/usr/local/apache2/php/bin/php
#
<?
for ($i=0; $i<10; $i++) {
$statement = "/usr/local/subversion/bin/svn help";
echo "\n\n$i***************************\n";
$handle = popen($statement, 'r');
echo "Subprozess: '$handle'; " . gettype($handle) . "\n";
$output = '';
while (!feof($handle)) {
$output .= fgets($handle);
}
echo $output;
pclose($handle);
}
?>
results
-------
/usr/local/apache2/php/bin/php -f test.php > test440_cli.txt
> works
wget -O test440_apache2.txt
http://brainkrash.com/~screen/test/test.php
> all 10 fail with no return from fgets
/usr/local/apache2/php/bin/php -f test.php >
test4-200507190640_cli.txt
> works
wget -O test4-200507190640_apache2.txt
http://brainkrash.com/~screen/test/test.php
> all 10 fail with no return from fgets
expected result
---------------
0***************************
Subprozess: 'Resource id #4'; resource
usage: svn <subcommand> [options] [args]
Subversion command-line client, version 1.2.1.
Type 'svn help <subcommand>' for help on a specific subcommand.
Most subcommands take file and/or directory arguments, recursing
on the directories. If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.
Available subcommands:
add
blame (praise, annotate, ann)
... <TRUNCATED>
failure results
---------------
0***************************
Subprozess: 'Resource id #2'; resource
<EOF>
------------------------------------------------------------------------
[2005-06-23 01:00:04] 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".
------------------------------------------------------------------------
[2005-06-15 19:16:03] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Try also the latest PHP 4 snapshot.
------------------------------------------------------------------------
[2005-06-15 15:54:16] thomas dot wetzler at siemens dot com
We tried out PHP Version 5. With the commandline (php.exe) it seems to
work but with the mod_php-module we get the same failure.
Because the testing of our application take a long time, it would be
good if you can find a solution for Version 4.
------------------------------------------------------------------------
[2005-06-11 15:18:48] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33296
--
Edit this bug report at http://bugs.php.net/?id=33296&edit=1