You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Israel Brewster <is...@frontierflying.com> on 2007/01/22 00:35:27 UTC

[users@httpd] mod_perl issue

I have a perl script running in apache 1.3 which generates a .png  
image. If i run it normally (using system perl), it works. When I try  
running it under mod_perl however (increased performance, works under  
chrooting), the first line of the png file data (the image headers)  
gets cut off, making it so the system no longer recognizes it a an  
image, and all I get is a bunch of giberish on the screen. Is there  
something I can do to fix this? Thanks.
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service INC.
5245 Airport Industrial Rd
Fairbanks, AK 99709
-----------------------------------------------



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] mod_perl issue

Posted by Israel Brewster <is...@frontierflying.com>.

On Jan 21, 2007, at 11:39 PM, Matus UHLAR - fantomas wrote:

> On 21.01.07 14:35, Israel Brewster wrote:
>> I have a perl script running in apache 1.3 which generates a .png
>> image. If i run it normally (using system perl), it works. When I try
>> running it under mod_perl however (increased performance, works under
>> chrooting), the first line of the png file data (the image headers)
>> gets cut off, making it so the system no longer recognizes it a an
>> image, and all I get is a bunch of giberish on the screen. Is there
>> something I can do to fix this? Thanks.
>
> what if you try to run it as CGI?

That works, if I understand what you are saying. Running it through  
the webserver just as a CGI (not using mod_perl) creates and displays  
the .png properly. it is only when running through mod_perl that  
there is an issue.

>
> I think that the first line should give server the content type,  
> optionally
> following a few header lines, and then the image...

I think you're right. Unfortunately, it's these first few lines that  
get chopped, leaving the server with no idea what type of file it is  
dealing with. As a result, it either just dumps the raw contents to  
the browser, or else downloads it as a binary. unfortunately, even  
then it can't display as it is missing some essential lines. As an  
example, if I run the command "less file.png" on a good .png image,  
the ASCII representation of the binary code for the first few lines  
is the following:

<89>PNG
^Z
^@^@^@^MIHDR^@^@^Co^....

and so on and so forth. The files created by the script (when run  
through mod_perl), however, look like so:

^Z
^@^@^@^MIHDR^@^@^Co^@

note that the <89>PNG portion is missing. It may be worth noting that  
the scrip has the option to create GIF's rather than PNG's, but the  
GIFS run into the same issue.

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service INC.
5245 Airport Industrial Rd
Fairbanks, AK 99709
-----------------------------------------------

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Re: [users@httpd] mod_perl issue

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 21.01.07 14:35, Israel Brewster wrote:
> I have a perl script running in apache 1.3 which generates a .png  
> image. If i run it normally (using system perl), it works. When I try  
> running it under mod_perl however (increased performance, works under  
> chrooting), the first line of the png file data (the image headers)  
> gets cut off, making it so the system no longer recognizes it a an  
> image, and all I get is a bunch of giberish on the screen. Is there  
> something I can do to fix this? Thanks.

what if you try to run it as CGI?

I think that the first line should give server the content type, optionally
following a few header lines, and then the image...
-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
He who laughs last thinks slowest. 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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