From: [EMAIL PROTECTED]
Operating system: i386 Linux
PHP version: 4CVS-2003-10-02 (stable)
PHP Bug Type: Filesystem function related
Bug description: popen returns wrong exitcode
Description:
------------
Apparently this has something to do with the environment-variables in the
shell, popen uses to execute the command. If I replace "echo FOO" with
"export" I get the whole line of variables and then it fails, whereas the
successful execution only has one, BASH=/bin/sh. I use php -n so no
php.ini is used.
Reproduce code:
---------------
<?php
$pp = popen("echo FOO", "r");
echo fread($pp, 4096);
var_dump(pclose($pp));
?>
Expected result:
----------------
FOO
int(0)
Actual result:
--------------
FOO
int(-1)
--
Edit bug report at http://bugs.php.net/?id=25727&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25727&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25727&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25727&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25727&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25727&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25727&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25727&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25727&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25727&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25727&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25727&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25727&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25727&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25727&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25727&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25727&r=float