GD library images not displaying
| From: | Ross Trewhella | Date: | Tue, 21 Jun 2005 15:47:40 +0000 |
| Subject: | GD library images not displaying | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-217320@lists.php.net to get a copy of this message | ||
Hi,
I am running Apache 2.0 with PHP 4.2.11 on Windows XP.
I installed php_gd2.dll by uncommenting extension=php_gd2.dll and making sure that the file was in
my extension_dir.
I restarted Apache and didn't get an error, so assumed it was working.
When I run my example code:
<?php
$im = imagecreatetruecolor (300, 200);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);
imagefilledrectangle($im,0,0,399,99,$white);
imagerectangle($im,20,20,250,190,$black);
header ("Content-type: image/png");
imagepng ($im);
?>
I get the following error:
Fatal error: Call to undefined function: imagecreatetruecolor() in imagetest.php on line 2
This code works on other servers, so where have I gone wrong in my installation of GD?
Thanks in advance,
Ross