ID:               26566
 User updated by:  taomyn at hotmail dot com
 Reported By:      taomyn at hotmail dot com
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: Windows 2000 and IIS 5
 PHP Version:      4.3.4
 New Comment:

Perhaps you could create a new function, or even add an extra optional
boolean parameter to EXEC() that would when "true" would not use
CMD.EXE?

E.g.
$no_cmd = true;
EXEC("c:\\winnt\\notepad.exe", $result, $status, $no_cmd);

This wouldn't break old code?


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

[2003-12-09 16:50:48] [EMAIL PROTECTED]

Because we use it as the shell to launch not only external processes,
but built-in commands such as dir that are not found in separate
binaries.

I can see the use, but can't see how to implement it without breaking
backwards compatibility.

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

[2003-12-09 16:34:56] taomyn at hotmail dot com

Description:
------------
Why does EXEC() have to spawn an extra CMD.EXE when executing a
program?

For example, to execute NOTEPAD.EXE, WORDPAD.EXE, even ImageMagicks
CONVERT.EXE, when called with EXEC() causes a CMD.EXE process to
executed which then calls the program requested. It's not needed.

Please can we have a version of EXEC that does not use CMD.EXE?

It's not always needed and can cause major issues such as hanging
sessions and hanging web services. A prime example are users of Gallery
by http://gallery.menalto.com - many of their Windows users have this
issue which is why they do not "officially" support Windows when it
should work.

Thanks,
Taomyn

Reproduce code:
---------------
Call any Windows program with EXEC() and you get a CMD.EXE process that
then calls the requested program.

E.g. exec("c:\\winnt\\notepad.exe",$result,$status);


Expected result:
----------------
Only NOTEPAD.EXE should appear.

Actual result:
--------------
"CMD.EXE /C NOTEPAD.EXE" and "NOTEPAD.EXE" appears in the process list


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


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

Reply via email to