CGI Programming OpenFAQ

Why does the browser show my script instead of run it?

Contributors:

The most common cause of this behavior is placing the cgi script in a directory that the web server software does not recognize as one from which scripts should be run.

Most web servers have configuration options that allow the webmaster to set up specific directories, very often something like /cgi-bin/ where cgi scripts must reside to be recognized as programs.

An alternative configuration is called cgi-anywhere, and uses a file extension (such as .cgi) to indicate that a file is a cgi script. As this alternate method offers nearly no security, it is seldom seen by users who have commercial Internet Service Providers. (I disagree with this comment -- the .cgi setup can be just fine if the server is configured to run scripts with the user ID of the user who owns them. -TB)


Previous | Next | Table of Contents

Follow us on Twitter | Contact Us

Copyright 1994-2012 Boutell.Com, Inc. All Rights Reserved.