- Your web server expects CGI scripts to be in a certain location,
such as a
cgi-bindirectory. Your script is located somewhere else. - Your web server recognizes CGI scripts by their file extension,
such as
myscript.cgiormyscript.pl. Your script has the wrong file extension. - Your script is on a Unix (or Linux) host, and you did not make the script executable with the chmod command.
- Your web host doesn't allow CGI scripts at all.
Unfortunately, no. CGI scripts execute on the server. The browser should never see the CGI script code. You need to configure the server correctly, or name and set the permissions of your script correctly to match the configuration that has already been done on your server. If you are seeing your CGI script code in your browser, then your server has not been configured to recognize the CGI script and treat it as a program.
If you run your own web server, see the official Apache 2.0.x CGI HOWTO and the official Apache 1.3.x CGI HOWTO. If you are running Internet Information Server, see how do I configure Microsoft Internet Information Server to allow CGI programs?
If you don't run your own web server, talk to the system administrator and find out how it recognizes CGI programs. Note: If you're using an inexpensive web host, there's a good chance CGI simply isn't included in your service.
Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.
Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!
Follow us on Twitter | Contact Us
Copyright 1994-2012 Boutell.Com, Inc. All Rights Reserved.
