#26566 [Opn]: Why does EXEC() have to use CMD.EXE
| From: | wez@php.net | Date: | Tue, 09 Dec 2003 21:50:49 +0000 |
| Subject: | #26566 [Opn]: Why does EXEC() have to use CMD.EXE | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51862@lists.php.net to get a copy of this message | ||
ID: 26566
Updated by: wez@php.net
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:
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.
Previous Comments:
------------------------------------------------------------------------
[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