Re: GD library images not displaying

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Found this in the PHP manual,


To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option --with-gd. GD library requires libpng and libjpeg to compile.

In Windows, you'll include the GD2 DLL php_gd2.dll as an extension in php.ini. The GD1 DLL php_gd.dll was removed in PHP 4.3.2. Also note that the preferred truecolor image functions, such as imagecreatetruecolor(), require GD2.





So, why not try upgrade your PHP version.

James



Ross Trewhella wrote:

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux