We are using MT 4.1 on 2.4.21-32.0.1.EL, Apache/2.0.55 (Unix) PHP/5.2.6, Image::Magick (version 6.4.1) and Perl 5.8.0.
Captcha image is not getting generated. We found that views/lib/MT/Util/Captcha.pm suddenly stops at line
my $im = $imbase->Montage(geometry => $geometry_str,
tile => $tile_geom);
Debug statements show that control does not go beyond this line.
Strange thing is that, a PNG image is generated if we execute ./mt-comments.cgi from command line after setting variables like
PATH_INFO to captcha/2/ayZZwvmHnNX2xoe4cFBuKxWTVrQlcpn6YFvAlEIZ" i.e. simulating that it is being executed by Apache as a cgi script. This time control goes beyond Montage() call.
Any clues/pointers? Please let me know if you need more configuration information.
Thanks,
Sameer
We found that gs (ghostscript) binary was not in the PATH, but still that did not resolve the issue yet.
We also wrote a minimal perl script using image magick library to create montage of 2 images. This too works from shell prompt but fails via Apache.
Most puzzling thing is that there is no single error message anywhere except that Apache says premature end of headers.
We also enabled CGI error log, but it prints nothing. As before, control does not go beyond Montage() call.
We have also printed all environment variables when script runs from Apache vs from command line and nothing is suspicious there.
MONTAGE in IMAGE MAGICK
Re: MONTAGE in IMAGE MAGICK
We found that Imagemagick is dumping core in LoadFontConfigFonts() in magick/types.c. This happens only when script is executed from Apache as a CGI script. Exact line is "00780 FcConfigDestroy(font_config);" but core is dumped in strlen() function from some .so from /usr/lib (I will post it soon as I don't have this info currently)
Re: MONTAGE in IMAGE MAGICK
We added a number of additional sanity checks in LoadFontConfigFonts() in ImageMagick 6.4.3-7 scheduled for release within a day or two. This may resolve the problem you posted. If not, let us know.