Web Analytics Made Easy -
StatCounter Unable to Fork - exec() - CodingForum


No announcement yet.

Unable to Fork - exec()

  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to Fork - exec()

    Ok guys. I'm getting the infamous "Unable to fork" message on my box at work:

    IIS 6.0, php 4.3.2, Windows Server 2003

    the code? Doesn't really matter. I get unable to fork regardless of what I feed the exec() command.

    I've read about giving access to the IUSR_machine account to cmd, but I can't find where to do this....(I found several IUSR accounts, and IWAM accounts, but not for the box....).

    Here's a sampling of code that doesn't work:

    PHP Code:
    exec("start /d C:\\windows /B notepad.exe");
    exec("start /d C:\\windows\\ /B notepad.exe"); 
    no combination of quotes and/or slashes works.
    moving notepad to ANY directory = still no help.

    shell_exec()'s only give me "Unable to ..."

    Any clues on this?

    Thanks guys,

  • #2
    Instead of:
    PHP Code:
    PHP Code:
    and see how that works out. If that doesn't do it, I'll keep thinking!

    Good luck,


    • #3
      Also, you may want to try putting a copy of notepad.exe in the same directory as your php file and try doing an exec on it directly. That way if it still doesn't work, you know it's not the slashes and whatever.

      FYI: I've been successful in the past using shell_exec and ensuring double-slashes in my strings.



      • #4
        sorry guys, I guess I wasn't clear - I've tried both of those....

        different exes, different locations (including same dir), doubleslashes, quadslash-triple-toe combos, you name it.

        I think it's either a cmd.exe permissions thing, or a an IIS permissions issue...


        • #5
          I do remember what you are trying to do working once with win98 and an older apache but I think that was a bug not a feature.

          I cheat and use <google_for>LaunchinIE</google_for> via the browser ... a useful tool if also a possible security issue.
          resistance is...

          MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)