Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does "CreateProcess failed" mean?

Status
Not open for further replies.

Guggly

Programmer
Joined
Jan 18, 2004
Messages
110
Location
US
I have a block of code that worked fine under Windows 2000, but now refuses to work under Windows XP. My code shell executes a command and then is supposed to return the STDERR output.

However, right after running the proc_open() command, I get an error which says "CreateProcess failed". There's nothing wrong with my command string, it worked fine in Windows 2000 and it works fine from the DOS Command Prompt.

What does "CreatProcess failed" mean? Is there any way that I can get more specific error information? Any help would be appreciated. -- Mike
 
The process you were trying to initialize failed. Its likely a permissions problem on that element.. It needs to be accessible to the same user running the web

Bastien

Cat, the other other white meat
 
I had a feeling that it was a permissions problem, but can't figure out how to set it properly. Any idea how to do that on Windows XP?
 
richt click the object, coose properties, security

Bastien

Cat, the other other white meat
 
I tried that and gave the IUSR permissions to what I'm trying to run (it doesn't matter what I attempt to run, nothing works). I've given full access to php.exe and it's libraries.

Now I've even tried to open up access on the whole drive (everything in C:\ has all the right permissions, but still nothing doing. It's driving me up a wall trying to figure out what else there could be that I can give access to
 
try the iwam user

Bastien

Cat, the other other white meat
 
Out of curiosity, what external command are you trying to run? Can you post the line from your script with the proc_open() invocation?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Bastien, the IWAM user has permission too. In fact, there's a whole slew of users or groups with permissions as follows:

Administrators
CREATOR OWNER
Everyone
IUSR
IWAM
SYSTEM
Users

I realize that isn't great security, but that's not the issue, I'm just trying to get it to work for now :)
 
sleipnir214, the program I'm trying to run is GnuPG, but any program that I attempt to run, or even a DOS Command like "dir c:\" fails. Here's my proc_open() code:

Code:
$descriptorspec = array(
     2 => array("pipe", "w")
);

$process = proc_open($command_line, $descriptorspec, $pipes);

     if (is_resource($process)) {
          while (!feof($pipes[2])) {
                 $text_output .= fgets($pipes[2], 1024);
            }

          fclose($pipes[2]);
          proc_close($process);
          return $text_output;
     }

The value of $command_line is as follows:
Code:
c:\gnupg\gpg --always-trust -r XXXXXXXX -r XXXXXXXX -a --yes -o "OUTPUTFILENAME" --set-filename "FILENAME" -e "SOURCEFILENAME"

The syntax of the command above is correct, I can run it fine from the Command Prompt, it just won't shell from PHP.

BTW, I use PHP 4.3.4, Windows XP SP1 (fully patched) and IIS 5.1

Thanks! -- Mike
 
I'm not convinced this is a permissions problem.

Here's some things to try:

Check to see whether it's a problem running this from a web server by invoking the script using the php command-line app from a command prompt.

Try defining all three of the stdin, stdout, and stderr pipes in the descriptorspec parameter to proc_open(), even if you're not going to use them. You're only defining a stderr pipe. The application may require a stdin and stdout, even if it's not going to use them. BTW, does gpg send its output to stderr?

Since you're not doing any real manipulation of input and output pipes here, don't use proc_open(). Instead use exec().


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Well, I don't know exactly what I did and when, but it's working now exactly as above except that I seem to need to initialize $text_output before I can use it. Why is this? I didn't need to do so before. No big deal, but I'm just curious.

Anyways, thanks Bastien and sleipnir214 for your help.

PS:
Yes sleipnir214, GPG uses STDERR for it's output.
 
Insufficient data for a meaningful answer. You haven't posted enough code to know what exactly $text_output is and how your code uses it.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Hi,

We had the same error message, but above pointers did not help us in solving it. We found the solution in the fact that the IIS Admin Service on our W2003 server is running under Local System Account and the checkbox for letting it interact with the desktop was not checked. After restarting the services it worked.

Hope this helps someone.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top