Knowledge Essentials - 3Essentials Hosting

CGI: running CGI executables and CGI.EXEs vs EXEs

Article ID: 535

 Back to Search

Understanding CGI executable execution on a webserver:

It's important to note that a CGI executable is NOT a standard executable.  A CGI executable is not a standard exe file.  You can't just take a standard DOS or Windows executable program and run it as a CGI application on a webserver that supports CGI (even a Windows/IIS webserver).   A CGI application must be written to the CGI 1.1 Specification, including implementation of certain standards for input and output. 

Reference: http://blogs.msdn.com/david.wang/archive/2005/08/14/HOWTO-Setup-a-CGI-EXE-on-IIS.aspx

Running CGI executables:

In order to run a CGI a CGI executable on your website hosted on either our Windows Shared Hosting plans or Windows Dedicated Managed server plans:

  1. the application/executable must written to the CGI 1.1 specification
  2. the CGI executable must be placed in the "/cgi-bin" directory off your FTP root (this is not below httpdocs, it's at the same level as httpdocs).
  3. Depending on the server you are hosted on, we may need to enable CGI execution of your specific executable...
    • If you find your CGI executable (or the test cgi executable we've attached to this article, see below) does load/execute, then you do not need to contact support to enable CGI execution on your site.
    • If you find your CGI executable (or the test cgi executable we've attached to this article, see below) does not load/execute, then we may need to specifically enable execution for your specific CGI executable.  Please submit a request to the support team indicating that you need enablement of your CGI executables, and specify your actual executable's name(s) (you can specify multiple executables in a single request). 

CGI executable sample:

The associated download is a sample CGI executable which you can use on your site to test CGI executable execution... be sure to follow steps 2 and 3 above to ensure you're placing into cgi-bin directory (unzipped), and requesting cgi execution be enabled before you attempt to use the sample.

If you've properly followed those steps, when you visit www.yourdomain.com/cgi-bin/cgi-test.exe you will see

This is a test
Time: current date and time

Thank you to customer Daniel Jette for sharing this sample.

 
Downloads Associated With This Article
cgi-test.zip : sample CGI executable