From: ckeefer at us dot nomura dot com
Operating system: Windows XP Pro SP2
PHP version: 5.2.3
PHP Bug Type: Output Control
Bug description: php (CLI) exec function passes no stderr output
Description:
------------
PHP CLI version 5.1.8 thru 5.2.1 Windows Binary - exec() function, when
error is generated passes STDERR no problem to CLI window. 5.2.2+ STDERR
output has vanished. Nothing in documentation or search suggests what
happened. No other changes 5.2.1 just downloaded and tested with generic
setup (no php.ini or other modifications) stderr from exec() functions
perfectly. 5.2.2+ system() apparently passes stderr properly, but is not
useful for most of what we do. STDOUT appears to be fine all versions.
Oddly, 5.2.2+ versions still work correctly with cygwin/bash 3.1
Note in 5.2.2 changelog contains this bit:
- Fixed commandline handling for CLI and CGI. (Marcus, Johannes)
Thanks,
Chip Keefer
Reproduce code:
---------------
<?php
$result = exec('cd c:\non_existant; dir nonexistant');
echo "$result\n";
?>
Expected result:
----------------
NJPC3916:php5.22$ php test_exec.php
php test_exec.php
The system cannot find the path specified.
- Works properly with cygwin
Actual result:
--------------
C:\php5.22>php test_exec.php
C:\php5.22>
No STDERR
--
Edit bug report at http://bugs.php.net/?id=41874&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41874&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41874&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41874&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41874&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41874&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41874&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41874&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41874&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41874&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41874&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41874&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41874&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41874&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41874&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41874&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41874&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41874&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41874&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41874&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41874&r=mysqlcfg