Entry
I can not execute CGI scripts in the browser but they do run at the command line.
Oct 31st, 2001 23:35
Neil Hamilton, akus one,
This could be for any number of reasons. You don't actually say what
the error message is, but try the following:
1. Is your CGI script in an area designated for executing CGI? If you
have access to your server's error logs, you should be able to find
this out from the diagnostic messages. Normally, you should place cgi
scripts in a scriptaliased directory - eg. /cgi-bin/ You can't just
expect CGI scripts to work in a non-CGI directory. Although it's
technically possible by using options in .htaccess files (which you may
or may not have access to), it's not the norm.
2. Sometimes servers are configured to handle files ending in .cgi
extension as CGI scripts. Try adding .cgi to your script filename and
see if that helps.
3. Does your CGI script produce valid headers? Normally all scripts
should output "Content-type: text/html" on one line, then a blank line.
If this isn't the case, it will produce "Internal Server Error".
4. It is possible that suexec is enabled for your website and the
username/password of the script doesn't match that of the virtual
server running the script. Suexec would block such a script. Also, if
your script is writable by anyone other than your user, suexec will not
run it - they should have permissions 755 - rwxr-xr-x
Both these cases would produce internal server error