go ahead... be a heretic | |
PerlMonks |
HTML::Template::Pro - Issue with template files larger than 8Kby Uniden (Initiate) |
on Jul 08, 2014 at 16:11 UTC ( [id://1092752]=perlquestion: print w/replies, xml ) | Need Help?? |
Uniden has asked for the wisdom of the Perl Monks concerning the following question: My web server setup is: FreeBSD 10.0, Apache 2.4, Perl 5.16, HTML::Template::Pro 0.9510 After years of successfully using HTML::Template::Pro with FreeBSD 6.2, Apache 2.2 and Perl 5.x, I've recently moved everything to the stack named in the first line. Right after moving the Perl scripts over, I have noticed that some scripts did trigger following error in httpd: [Tue Jul 08 09:37:26.169883 2014] [cgid:error] [pid 49924] [client x.x.x.x:59214] malformed header from script 'test.pl': Bad header: <!doctype html>First of all, all my scripts use HTML::Template::Pro. I tried this and that, thinking that the error is somewhere in the Perl scripts, but couldn't find the cause of the error. Then I saw that scripts calling smaller templates don't crash, while larger templates would trigger the above error. Then I simplified to the bone and created following Perl script 'test.pl': ..and the template 'test.tmpl':
I ran test.pl and everything was fine, no error. Then I started adding a lot of blah blahs until the size of the template file size hit exactly 8,192 bytes, at which time it crashed with a 500 and with the above error logged in the httpd-error.log. If I delete a single character from the template file so it goes below 8K, the script runs again. I have absolutely no idea why this happens. By the way, large html files do not crash Apache, nor do Perl scripts printing html code directly (without HTML::Template::Pro. I tried both to the extreme, creating MBs of html code and wasn't able to crash anything at all. I am not aware of any settings that I could change for HTML::Template::Pro. If anyone has an idea what I could do to prevent this from happening, I am all in for experiments.
Back to
Seekers of Perl Wisdom
|
|