note 34515 added to ref.exec
| From: | software at yvanrodrigues dot com | Date: | Tue, 29 Jul 2003 19:55:04 +0000 |
| Subject: | note 34515 added to ref.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52964@lists.php.net to get a copy of this message | ||
MORE ON THE UNABLE TO FORK MESSAGES IN WINDOWS:
I would like to confirm that this issue relates to permissions on %SYSTEMROOT%\SYSTEM32. The user
(usually the anonymous login) must have execute permissions on cmd.exe
This is unlike most other programming languages. For example, in C the spawn and exec functions do
not try to open a shell, they create the new process directly. PHP creates the new process via
cmd.exe (or command.com) much like the C system() function. This is good for those of you who are
trying to run batch files but this is very ineffecient for running other .exe files.
I feel uneasy about lifting permissions in my system32 directory but you can get around this by
copying cmd.exe to your PHP directory. Windows will look there first and if it is not there it will
check the path. Note: I mean the directory where php.exe is, not your script directory.
I have confirmed this by running filemon.exe while trying to execute a script, and you can see it
trying to start the cmd.exe process.
----
Manual Page -- http://www.php.net/manual/en/ref.exec.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34515
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34515&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34515&report=yes