The Movable Type Knowledge Base

Source Code Appears In Browser

Question

When I try to run any of the Movable Type files, I see the source code of the CGI script in my browser.

Answer

If you see the source code, then your webserver has not been configured to run CGI scripts from the folder where you've installed Movable Type.

This is not something that you can configure yourself on a hosted account, so you will need to contact your hosting provider and ask them to enable CGI for your account (or for the webserver as a whole).

If you run your own webserver, or if you have access to the webserver configuration files (and the privileges to restart the webserver, after modifying the configuration), you can use these steps to enable CGI scripts on your webserver. The following instructions assume that you are running Apache.

  • Find the configuration file httpd.conf, and open it up in an editor.

  • Find the Directory or Location block that configures the webroot for the server. Inside of that block, add this line:
    Options +ExecCGI
  • Outside of the Directory or Location block, add the line:
    AddHandler cgi-script .cgi
  • Restart the webserver.
  • CGI scripts should now execute, instead of merely displaying their source.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.