Smart questions
Smart answers
Smart people
Join Tek-Tips Forums

Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

What does "CreateProcess failed" mean?

Guggly (Programmer) (OP)
17 Jul 04 9:30
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
Bastien (Programmer)
17 Jul 04 20:55
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


Cat, the other other white meat

Guggly (Programmer) (OP)
18 Jul 04 5:36
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?
Bastien (Programmer)
18 Jul 04 10:24
richt click the object, coose properties, security


Cat, the other other white meat

Guggly (Programmer) (OP)
18 Jul 04 12:33
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
Bastien (Programmer)
18 Jul 04 14:37
try the iwam user


Cat, the other other white meat

sleipnir214 (Programmer)
18 Jul 04 14:48
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!


Guggly (Programmer) (OP)
18 Jul 04 16:52
Bastien, the IWAM user has permission too. In fact, there's a whole slew of users or groups with permissions as follows:


I realize that isn't great security, but that's not the issue, I'm just trying to get it to work for now :)
Guggly (Programmer) (OP)
18 Jul 04 16:53
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:


$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);

          return $text_output;

The value of $command_line is as follows:


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
sleipnir214 (Programmer)
18 Jul 04 18:00
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!


Guggly (Programmer) (OP)
19 Jul 04 15:36
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.

Yes sleipnir214, GPG uses STDERR for it's output.
sleipnir214 (Programmer)
19 Jul 04 15:42
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!


pdvente (TechnicalUser)
21 Jul 04 8:30

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.


Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close