ID:               45376
 Updated by:       [EMAIL PROTECTED]
 Reported By:      louis at steelbytes dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         CGI related
 Operating System: Vista SP1 x64
 PHP Version:      5.2.6
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php




Previous Comments:
------------------------------------------------------------------------

[2008-06-27 09:48:58] louis at steelbytes dot com

Description:
------------
1. proc_open('I_dont_exist.exe') returns true.  I feel it shouldn't
(I'm guessing this is because php launches cmd.exe and asks it to run
I_dont_exist.exe)

2. popen('I_dont_exist.exe') returns true if I execute the script from
the commandline using php.exe -n -f test.php (see above for what I would
expect), but if I execute it via php-cgi.exe in IIS, I get HTTP Error
502.2 - Bad Gateway (see below).

Reproduce code:
---------------
        $proc = @proc_open(
                'c:\\I_dont_exist1.exe'
                ,array( 0=>array('file','nul','r'), 1=>array('file','nul','w'),
2=>array('file','nul','w') )
                ,$pipes
                );
        if ($proc===false)
                die('failed proc_open');
        proc_close($proc);
        echo 'proc_open ok'."<br>\r\n"; 
        $proc = @popen('c:\\I_dont_exist2.exe','r');
        if ($proc===false)
                die('failed popen');
        pclose($proc);
        echo 'popen ok'."<br>\r\n";     


Expected result:
----------------
ideally both should fail, as the target .exe doesn't exist, but not
cause the script to die

Actual result:
--------------
HTTP Error 502.2 - Bad Gateway
The specified CGI application misbehaved by not returning a complete
set of HTTP headers. The headers it did return are
"'c:\I_dont_exist2.exe' is not recognized as an internal or external
command, operable program or batch file. X-Powered-By: PHP/5.2.6
Content-type: text/html start<br> proc_open ok<br> popen ok<br> end<br>
".


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45376&edit=1

Reply via email to