ID:               30794
 Updated by:       [EMAIL PROTECTED]
 Reported By:      stolle at web dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Program Execution
 Operating System: Windows XP SP2
 PHP Version:      5.0.2
 New Comment:

I don't see any bugs here. It's pretty well expected behaviour.
The docs say: "If you start a program using this function and want to
leave it running in the background, you have to make sure that the
output of that program is redirected to a file or some other output
stream or else PHP will hang until the execution of the program ends."
But your program *waits for your input* (i.e. until you close it), so
PHP will wait for it too, 'cause exec() "returns the last line from the
result of the command" (c).


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

[2004-11-15 14:47:22] stolle at web dot de

Description:
------------
I'm using PHP on Apache2 (both: Latest Builds)

When starting a Program using "exec()" die PHP-Scripts allways hangs
under Windows, until the started program terminates.

There is no chance to start f.e. notepad.exe in that way, that notepad
runs interaktivly, but PHP continous work.

Notepad is just an example, i want to control (start and stop) some
Windows-Tasks throug PHP.

I tried the latest PHP snapshot-Version as well.

Reproduce code:
---------------
    exec('notepad.exe');

    exec( "cmd.exe /c c:/windows/notepad.exe 2>nul: >nul:" );


    exec( "c:/windows/notepad.exe 2>nul: >nul: &" );

    exec( "c:/windows/notepad.exe 2>nul: >nul:" );


Expected result:
----------------
PHP Script should NOT wait for end of notepad

Actual result:
--------------
PHP Script wait's for end of notepad


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


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

Reply via email to