On 2 September 2013 21:42, obsd, cgi <[email protected]> wrote: > http://unix.stackexchange.com/questions/88062/how-to-enable-cgi-in-openbsd > > How could someone use a CGI (with a shell script) on OpenBSD? What could > the problem be? > > The CGI is this: > > # cat /var/www/htdocs/cgi-bin/SEARCH.cgi > printf "Content-type: text/html\n\n"; > printf hi > > but it keeps saying: > > > # cat /var/www/logs/error_log > [Mon Aug 26 10:09:13 2013] [error] [client 10.0.2.2] Premature end of > script headers: /htdocs/cgi-bin/SEARCH.cgi > # > > > yes, I tried many things..(permissions looks good, printf binary copied to > chroot, httpd.conf looks ok..) several hours of pain.. can someone post a > howto/URL? > > Thanks, have a better day :)
Hi, I spotted that you are not using #! at the beginning of the file. Try #!/bin/sh for example. Patrick also mentioned the line that should help with premature end of script headers errors. -- Sincerely, Ville

