CGI and find

Dar Scott dsc at swcp.com
Tue Sep 2 14:07:01 EDT 2003


On Tuesday, September 2, 2003, at 11:10 AM, J. Landman Gay wrote:

> When I run this "find" script as a cgi, I get a "malformed header" 
> error in the system log:
>
>   malformed header from script. Bad header=0 0: 
> /Library/WebServer/CGI-Executables/search.mt
>
> Why would a header be "malformed" in the second case and not in the 
> first? What difference would it make how the content was collected? 
> Every other part of both scripts is identical.

Maybe running this as a command line app will allow you to see what is 
written to stdout.  I get the impression from your mail that you are 
doing this, but I thought I'd mention this.

Maybe an error message is written to stdout instead of stderr.  Maybe 
the http server is collecting up both.

For example, maybe you have a permissions problem with the stack.

Try wrapping the find in a try-catch and put error info in the buffer 
and see what the web browser displays.  This might prevent an error 
from writing to the stdout and messing up the headers.  This might be a 
good thing to do near the top anyway.

Just babbling.

Dar Scott






More information about the use-livecode mailing list