Edit report at http://bugs.php.net/bug.php?id=53591&edit=1
ID: 53591
User updated by: sbacsa at gmail dot com
Reported by: sbacsa at gmail dot com
Summary: exec() fails to impersonate calling context when
fastcgi.impersonate is true
Status: Bogus
Type: Bug
Package: IIS related
Operating System: Windows Server 2008
PHP Version: 5.3.4
Block user comment: N
Private report: N
New Comment:
I have done all of that, and that was not a solution.
If you disable fastcgi.impersonate, then it will run in the user context
of the
worker process (whatever you set it to; I set it to a custom user
account), so
clearly it DOES impersonate the user, but it just does not seem to work
with
whatever fastcgi.impersonate tries to do.
That being said, this was not an issue in PHP 5.2.x; it worked with
fastcgi.impersonate and did not cause errors. All I did was replace the
PHP
binaries with the new version and configured IIS. There should be no
reason why
it should fail.
Previous Comments:
------------------------------------------------------------------------
[2010-12-22 01:02:55] [email protected]
You have to give FCGI's php handler the permission to execute codes.
Check out the IIS documentation (as far as I remember it is also
documented in the PHP manual, in the IIS configuration part).
------------------------------------------------------------------------
[2010-12-22 00:10:41] sbacsa at gmail dot com
Description:
------------
It appears that enabling fastcgi.impersonate on Windows in PHP 5.3.x
does not
actually impersonate the calling user when using exec() or similar.
I would just get messages saying "Cannot fork", whereas in PHP 5.2.x
there was no
such error.
Turning off fastcgi.impersonate fixed this issue, as IIS seems to run
PHP in the
user context of the worker process anyway.
Test script:
---------------
<?
// This will fail when fastcgi.impersonate = 1 in PHP 5.3.x
exec("c:\\path\\to\\executable.exe");
Expected result:
----------------
The file should be successfully executed if the worker process user has
permission
to access the EXE.
Actual result:
--------------
Regardless of worker process permissions, an error message saying:
"Warning: exec() [function.exec]: Unable to fork
[c:\path\to\executable.exe]"
is encountered.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53591&edit=1