Help! My CGI Stopped Working!

A recent change in the CSAIL Web servers has caused some CGI scripts to stop working. We have identified two common causes for this problem:

500 Internal Server Error

Whatever the problem is, you will see a better clue as to the cause by reading the error log on the web server. If you see a message about "No such file or directory", check to make sure that your script specifies an accurate path to its interpreter -- for example, /usr/bin/perl, not /usr/local/bin/perl.

(If, by the way, you find that there is some module or package that you need which is not currently available on the Web servers, please let us know.)

Server sends text of script rather than executing it

Previously, files ending in .pl and .py were assumed to be CGI scripts; now they are not. Files ending in .cgi were, and will continue to be, recognized. There are two ways to fix this:
  1. Rename the script. Note that doing this will break existing links and bookmarks, which is widely considered to be a Bad Thing. (Our servers have MultiViews turned on globally, so you should be able to leave the ending out of links, so that you don't expose implementation details to all and sundry.)
  2. Add AddHandler cgi-script .pl to your .htaccess file. This tells the server to interpret .pl in the way it used to. (Likewise for .py.)

-- GarrettWollman - 15 Aug 2007
Topic revision: 09 Mar 2011, ArthurProkosch
 

MIT Computer Science and Artificial Intelligence Laboratory

 

  • About CSAIL
  • Research
  • News + Events
  • Resources
  • People

This site is powered by Foswiki MIT: Massachusetts Institute of Technology