Monday, March 17, 2008

"The system cannot execute the specified program" Error

You are trying to run some program on Windows (such as apache.exe or htpasswd.exe) and you are getting "The system cannot execute the specified program" error. This usually means that the program you are trying to run was compiled against DLLs that are not on your system. You should use Dependency Walker to see which DLLs are missing, and then install them.

The Apache 2.x binary windows distribution, specifically, was compiled against the Visual Studio 2005 re-distributable package, which you can download from microsoft.

Further reading (1) and (2)

Edit (Nov 2011):
Following this comment (by Annonymous) please note that you may need to download and use the 2008 package and not the 2005 one: The official download for the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) or The official download for the Microsoft Visual C++ 2008 Redistributable Package (x64)


15 comments:

  1. What a coincidence I just had to find it and use last week.

    You probably know this, but linux alternative is ldd.

    ReplyDelete
  2. I was trying to get Apache to run on a new install of Windows XP. I have updated to SP3. I could normally install a WAMP stack such as Wampserver, EasyPHP, or XAMPP without a problem. However, I could not get apache.exe to run.

    This blog post was one of the top results returned when I searched for "easyphp the system cannot execute the specified program" on Google. Although this did not work for me, it was a step in the right direction. Perhaps it is because this post is dated, but I had to install the 2008 version of the redistributable packages.

    The official download for the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) is available here: http://www.microsoft.com/download/en/details.aspx?id=5582

    The official download for the Microsoft Visual C++ 2008 Redistributable Package (x64) is available here: http://www.microsoft.com/download/en/details.aspx?id=15336

    I hope this helps some people who were experiencing the same problem as me.

    Thank you for your post all the same.

    ReplyDelete
  3. Thanks Vitaly, you are right! It works for me too!

    ReplyDelete
  4. oh yeahhhhhhh!! after 3 vc++ packages (2010,2005 and 2008), finally the last one worked :D

    thanks all.
    BR,
    Pinela.

    ReplyDelete
  5. Hello had the same problem: the system cannot execute the specified program
    downloading from Microsoft url
    http://www.microsoft.com/download/en/details.aspx?id=5582 and installing resolved the issue

    ReplyDelete
  6. Just want to add that installing Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) worked for me (was trying to install xampp on a virtual server). I hadn't run any Windows updates since installing XP on a virtual server, so most likely dll's were missing.

    ReplyDelete
  7. Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) has solved the issue.

    Thanks, thanks, thaaaanks!

    ReplyDelete
  8. Thank you for posting this.
    I was trying to install EasyPHP 5.3.9 and I was getting the error
    EasyPHP Error in Apache configuration file
    Installing Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
    fixed this for me too

    ReplyDelete
  9. Thanks, It worked for me too, I was running XP SP3 on a VM and installing "Microsoft Visual C++ 2008 SP1 Redistributable" did the magic.

    ReplyDelete
  10. I was trying to install XAMPP and was totally stuck until I found this, thanks for posting!

    ReplyDelete
  11. I had the same problem and now it works fine after installing Microsoft Visual C++ 2008 SP1 Redistributable Package (x86).
    Thanks a lot!

    ReplyDelete
  12. Thanks for your advice... work for me.....

    ReplyDelete
  13. It worked for me too| Thanks a lot!

    ReplyDelete
  14. Thanks u the best man

    ReplyDelete

[Due to much spam, comments are now moderated and will be posted after review]