Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 58564 invoked from network); 7 Mar 2004 14:12:25 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 7 Mar 2004 14:12:25 -0000 Received: (qmail 72828 invoked by uid 500); 7 Mar 2004 14:12:06 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 72675 invoked by uid 500); 7 Mar 2004 14:12:05 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 72655 invoked from network); 7 Mar 2004 14:12:05 -0000 Received: from unknown (HELO smtp-out2.blueyonder.co.uk) (195.188.213.5) by daedalus.apache.org with SMTP; 7 Mar 2004 14:12:05 -0000 Received: from zync.co.uk ([82.37.0.133]) by smtp-out2.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Sun, 7 Mar 2004 14:12:05 +0000 Message-ID: <404B2D77.5030202@zync.co.uk> Date: Sun, 07 Mar 2004 14:11:03 +0000 From: Richard Gration User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 X-Accept-Language: en MIME-Version: 1.0 To: users@httpd.apache.org References: <3462.10.0.0.158.1078588037.squirrel@62.166.29.194> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Mar 2004 14:12:05.0062 (UTC) FILETIME=[2B1EDE60:01C4044E] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: Re: [users@httpd] Scripts cannot be executes X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hendrik-Jan van der Waal wrote: > LS. > > I'll keep this short because I'm not sure if this is the right place. > > My site (www.pick.nl) uses a lot of perl scripts. Every now en than users > get an internal server error. In the error log of apache, which I got from > my ISP, the internal server error is a result of a premature end of > headers, which is caused bij a memory allocation error (Can not exec > scriptname.cgi) > > My ISP doesn't know why the error occurs, there is enough memory. Is there > any one who recognizes this problem. Is this a configuration problem or > are my scripts faulty? The usual cause of this error is line end characters. When the cgi is uploaded, there are a variety of reasons why the file could end up on the (Unix) server with CRLF line terminators (CR == carriage return == ascii char 13 == Ctrl+M == ^M). The shebang line ends up being: #!/usr/bin/perl^M There is unfortunately no file called /usr/bin/perl^M on unix systems, just one called /usr/bin/perl. This is why the exec fails. Fortunately the fix is easy. You can: Either 1) Specify the shebang line as "#!/usr/bin/perl -w" - this pushes the spurious ^M to after the -w so that the name of the perl executable is preserved. (not recommended) Or 2) Edit the file once it is on the server and save it in unix format (LF line terminators), or use dos2unix (very tedious and easy to forget) Or 3) Sort out your Windows editing and ftp programs so that the LF line terminators are preserved during editing and transfer (the "right" way) Or 4) Stop using Windoze. (recommended - YMMV ;-) ) HTH Rich --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org