Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <41560B26.FCC450C7@dessent.net> Date: Sat, 25 Sep 2004 17:19:50 -0700 From: Brian Dessent Organization: My own little world... MIME-Version: 1.0 To: cygwin AT cygwin DOT com CC: lighttpd AT lists DOT kneschke DOT de Subject: Re: lighttpd - problems with cgi scripts References: <4155E9CE DOT 5060903 AT familiehaase DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com "Gerrit P. Haase" wrote: > #!/usr/bin/perl > > use strict; > use CGI::Carp qw(fatalsToBrowser); > > print "Content-type: text/html\n\n"; ^^^^^ This is not a valid CGI script. All HTTP headers must be terminated by CRLF, so you'd have to use "\r\n\r\n" here. But it's generally regarded as a bad thing to explicitly emit headers yourself if you're using the CGI module, which takes care of all such things for you. As you noted your example that does it the right way (by calling header()) works fine. Traditionally, Apache has been able to work around CGI script authors that can't read RFC2616, which is why you'll still find examples of crap like this on the web. But apparently lighthttpd is not as forgiving. > However, I have a complex script here which works. There I get an error > when I try to connect a postgres database, DBI says: > could not create socket: Operation not permitted > > I tried to connect from perl to postgres that works, then I tried the > same script calling from lighttpd, it fails with the above mentioned > symptoms. This sounds suspiciously like the "SYSTEMROOT being removed from the environment" problem. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/