DarkSky WS
11-06-2002, 05:06 PM
If I run a .cgi script from the command line and get the html output of a web page, shouldn't I be able to see this web page when running the script from the browser? All I get is a server error.
The logs show me no errors though.
The script has all proper permissions, etc.
Any help appreciated.
thanks
SPaReK
11-06-2002, 06:11 PM
Be sure you have the line:
print "Content-type: text/html\n\n";
before you print any HTML output. Without the above line, the browser will not parse the HTML contents of the script.
DarkSky WS
11-06-2002, 06:15 PM
yup - that's there.. still same problem..
SPaReK
11-06-2002, 06:17 PM
What error message are you getting?
DarkSky WS
11-06-2002, 06:27 PM
In the browser I am only getting 'internal server error'.
There is nothing in the apache log. the suexec log shows the .cgi file being executed, but with no errors.
running the script from the command line on the server shows the outputted html code.
crouzer
11-06-2002, 10:40 PM
Check the server errors log file.
Either the CGI is not executing or your header is not printed correctly (as shown correctly above).
Chuck
chuckt101
11-07-2002, 09:30 AM
If you edited the file locally and uploaded it, make sure you uploaded it in ascii.
chrisblack
11-07-2002, 10:35 AM
Did you CHMOD it to 0755 mode as well?
DarkSky WS
11-07-2002, 11:07 AM
file was uploaded in ascii.. it is 755
when running from command line on the server (perl ./script.cgi) I see the html dump - but browser gives internal server error with no errors in the suexec log file.
SPaReK
11-07-2002, 11:35 AM
Just out of curiosity try this script and see if it works:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello World!";
of course change the path to perl to reflect the path on your server.
DarkSky WS
11-07-2002, 02:18 PM
Thanks to all for their help...
The problem was caused by WS_FTP. It should have been uploading .cgi files in ASCII mode and instead was sending them in binary mode.