You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jeff Zhuk <je...@yahoo.com> on 2009/04/27 17:57:14 UTC

Internal Server Error and malformed header from script

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 error.log I could see "malformed header from script" and "did not send an HTTP header"
 
Several people helped me to navigate over multiple related articles. Although we focused mostly on the httpd.conf file, in my case the problem was in the script itself.
 
I commented the first line in my test.pl and this made the magic.
Before moving to mod_perl I needed this line, but apparently not anymore.
 
#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";

 
Here is the config in httpd.conf
 
<Directory "C:/myScripts/" >
<Files ~ "\.(pl|ip|plx)$">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
#PerlSendHeader On
</Files>
Order allow,deny
Allow from all 
</Directory>

-----------------------------------------------
Thank you to everyone who responded to my messages, espesially Randy and Andre,
 
Jeff Zhuk


      

Re: Internal Server Error and malformed header from script

Posted by André Warnier <aw...@ice-sa.com>.
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.