ID:               27051
 Comment by:       benadler at gmx dot net
 Reported By:      ghoffer at globalscape dot com
 Status:           Feedback
 Bug Type:         Feature/Change Request
 Operating System: Windows
 PHP Version:      5.3
 Assigned To:      pajoye
 New Comment:

Ok, it works on the commandline but not using IIS6 and fastcgi with
fastcgi.impersonate = 1;.

This is test.php:

<?php
$out = array();
echo exec("echo %USERNAME%", $out);
print_r($out);

$out = array();
echo exec("echo %USERPROFILE%", $out);
print_r($out);
?>

and this results in:

%USERNAME%Array
(
    [0] => %USERNAME%
)
C:\Documents and Settings\Default UserArray
(
    [0] => C:\Documents and Settings\Default User
)

So it seems the user's profile/environment is not correctly set up.

I think username should be either domain\deabjs1 or just deabjs1,
because this is what I use to log on to IIS using NTLM. I'm still using
the same snapshot I was using at [6 Sep 6:13pm UTC].

Thanks for your help!
ben


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

[2009-09-06 18:13:09] benadler at gmx dot net

I tried the newest snapshot and it seems to work - thank you!

But, could it be that the environment is not set up correctly?
Suddenly I start getting all those imagemagick-temp files in the
script's directory. I imagine the reason may be that the %TEMP% or
%TMP% system/user variables are not set correctly.

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

[2009-09-03 21:17:45] paj...@php.net

Please (all :) try a snapshot, php 5.3 or 6 (5.3 recommended anyway
:).



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

[2009-09-03 19:16:50] s...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=288004
Log: - #27051, improve fix on xp/2k3

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

[2009-09-03 19:16:17] s...@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=288003
Log: - #27051, improve fix on xp/2k3

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

[2009-09-03 15:52:24] benadler at gmx dot net

I updated to php-5.3-nts-win32-VC9-x86-latest.zip yesterday night. The
impersonation problem with iis6 and fastcgi was fixed, but when starting
a php-script from the command line/dosbox, I get:

Warning: exec(): Unable to fork [imconvert.exe ...] in scriptname.php
on line X

Using exec() works fine when the scripts are called from IIS, though.
The failing scripts have worked fine before updating php.

I traced the execution using sysinternals process monitor, and

Process Create
C:\WINDOWS\system32\cmd.exe
cmd.exe /c "imconvert "tif:D:/data/foo.tif[0]" "D:/data/bar.jpg""

shows SUCCESS, but it seems imconvert.exe is never started, as it
doesn't show up in the trace. Process Monitor shows that the php script
is running as the user who's currently logged in, but I cannot see which
user is trying to start convert.exe

Can I help with more info?

ben.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/27051

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

Reply via email to