Internal Server Error and malformed header from script

Internal Server Error and malformed header from script

am 27.04.2009 17:57:14 von Jeff Zhuk

--0-1704597526-1240847834=:722
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

After moving to mod_perl with Apache 2.2 I had this problem while running a=
simple test.pl
=A0
The browser displayed: "HTTP 500 - Internal Server Error" and in the error.=
log I could see "malformed header from script" and "did not send an HTTP he=
ader"
=A0
Several people helped me to navigate over multiple related articles. Althou=
gh we focused mostly on the httpd.conf file, in my case the problem was in =
the script itself.
=A0
I commented=A0the first=A0line in my test.pl and this made the magic.
Before moving to mod_perl I needed this line, but apparently not anymore.
=A0
#print "HTTP/1.0 200 OK\n"; ## !!! This line is extra while using mod_perl =
!!! - JZ
print "Content-Type: text/html\n\n";
print "\n";
print "HELLO!\n";

=A0
Here is the config in httpd.conf
=A0


SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
#PerlSendHeader On

Order allow,deny
Allow from all=20


-----------------------------------------------
Thank you to everyone who responded to my messages, espesially Randy and An=
dre,
=A0
Jeff Zhuk =0A
--0-1704597526-1240847834=:722
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">
After moving to mod_perl with Apache 2.2=
I had this problem while running a simple test.pl

 

The browser displayed: "HTTP 500 - Internal Server Error" and in the e=
rror.log I could see "malformed header from script" and "did not send an HT=
TP header"

 

Several people helped me to navigate over multiple related articles. A=
lthough we focused mostly on the httpd.conf file, in my case the problem wa=
s in the script itself.

 

I commented the first line in my test.pl and this made the m=
agic.

Before moving to mod_perl I needed this line, but apparently not anymo=
re.

 

#print "HTTP/1.0 200 OK\n"; ## !!! This line is extra while using mod_=
perl !!! - JZ
print "Content-Type: text/html\n\n";
print "\n";
pri=
nt "HELLO!\n";

 

Here is the config in httpd.conf

 

<Directory "C:/myScripts/" >
e=3D2>
<Files ~ "\.(pl|ip|plx)$">

SetHandler perl-script

PerlResponseHandler ModPerl::Registry

PerlOptions +ParseHeaders

Options +ExecCGI

#PerlSendHeader On

</Files>

Order allow,deny<=
/DIV>
Allow from all

</Directory>


----------------------------------------------- >
Thank you to everyone who responded to my messages, espesially Randy a=
nd Andre,

 

Jeff Zhuk


--0-1704597526-1240847834=:722--

Re: Internal Server Error and malformed header from script

am 27.04.2009 19:24:16 von aw

Jeff Zhuk wrote:
....
Jeff,
whenever you send a message to the mod_perl list, I get a copy, because
I am subscribed to the list.
Then I get another copy, because you also send a copy to me directly.
So I get each message twice.
I guess it's the same for Randy.
It is not a real problem, but it is annoying, so stop doing this, and
send your messages to the list only, please.
Thanks.