Using GD causes Apache Segmentation fault w/ PHP 4.3.9, Apache 2, RedHat AS
Posted on 2004-10-20
I have installed PHP 4.3.9 on RedHat AS with Apache 2. Any script that accesses gd related functions causes the httpd process to die with this error: [notice] child pid 30391 exit signal Segmentation fault (11). I have gd-1.8.4 and gd-devel-1.8.4 on the system but my understanding is that PHP comes bundled with its own version which it uses unless otherwise instructed during the build. The exact same config below works fine on our box running php-4.3.2, RedHat 7 with Apache 1.
Here is the config:
Here is a sample script I used:
header ("Content-type: image/png");
$im = @ImageCreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
$text_color = ImageColorAllocate ($im, 233, 14, 91);
ImageString ($im, 1, 5, 5, "A Simple Text String", $text_color);
I tried building GD 2 from source and forcing PHP to compile against those headers under /usr/local/ but php make died with some errors related to undefined gd* functions. If it matters, I installed libjpeg-devel-6b-30 and libpng-devel-1.2.2 RPMs before building php. I'm at a loss and this issue is delaying our launch window for an important new product that uses jpgraph (thus gd) so any help will be greatly appreciated! Thanks.