apache, cgi and perl

g3t

2001-10-20 00:41:00

This is kinda off-topic but.. I see you have ultimatebb runnin..

I have web sharing enabled on 10.1, and when I go to exec a .pl or .cgi I get this error...

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

------------------------------------------------------------------------
Apache/1.3.20 Server at 127.0.0.1 Port 80

I read the apache help docs and set the the files are all chmod'd 755...

Here's the error in the apache error_log:

[Fri Oct 19 16:27:21 2001] [error] [client 64.241.221.45] Premature end of script headers: /Library/WebServer/Documents/cgi-bin/hello.pl
[Fri Oct 19 16:27:34 2001] [error] (2)No such file or directory: exec of /Library/WebServer/Documents/cgi-bin/hello.cgi failed
[Fri Oct 19 16:27:34 2001] [error] [client 64.241.221.45] Premature end of script headers: /Library/WebServer/Documents/cgi-bin/hello.cgi

I do not know what to do next..... ?

orange1

2001-10-22 15:10:00

first thing i would check would be if you have a one line file with a buttload of ^M characters in it.
if so, delete them and replace with return carriages.

....

at least i think this effects osx. it was keeping me from compiling cpp files. if you have a nice text editor [mmmm, bbedit], you can set it to save files with unix endlines, instead of mac ones.

ziwdam

2001-10-25 03:33:00

Originally posted by willy wonka:
first thing i would check would be if you have a one line file with a buttload of ^M characters in it.
if so, delete them and replace with return carriages.


You can also do this in Terminal.app:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre> tr '\r' '\n' < file > file.out </pre>[/quote]

That will convert file from Mac line endings to UN*X line endings, and save the output into file.out.

Devin

2003-10-26 00:42:00

The wrong line endings will definitely make a difference.

What you've given isn't too much to go on, but here are some other things to check --

look in the apache error_log ([usr]/local/apache/logs/error_log) for useful hints

run the script from the command line and look for error messages.

-- devin