Online Shopping : Computers : Internet : Web Servers : Apache

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

11 of 35 people (31%) answered Yes
Recently 1 of 10 people (10%) answered Yes

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