phpinfo() gives me:
Configure command:
......'--with-gd' '--with-png-dir=/usr/local/php' '--with-freetype-dir=/usr/local/php' '--with-t1lib=/usr/local/php' '--with-jpeg-dir=/usr/local/php' '--with-tiff-dir=/usr/local/php' ....etc.
GD :
GD Support -- enabled
GD Version -- bundled (2.0.12 compatible)
FreeType Support --enabled
FreeType Linkage with freetype T1Lib Support --enabled
GIF Read Support -enabled
JPG Support --enabled
PNG Support --enabled
...etc...
I un-commented : "extension=php_gd2.dll" in the php.ini
I re-started Apache.
This sample script I pasted from the php manual (imagecreate function) works fine:
Code: Select all
<?php
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);
imagepng ($im);
imagedestroy ($im);
?>I am unable to use the imagecreatetruecolor function which I understand is only on gd2 or later. I can't get imagecreate to work at all with jpg (not talking about quality of images, just functioning) ...I substituted jpg for png but no-go. In fact, DWMX highlighting indicates something wrong as soon as I try to change imagecreate to imagecreatetruecolor.
In the php manual, someone wrote a script to check which version of gd is installed...I ran it and it says "you have version less than 2"
Code:
Code: Select all
<?php
ob_start ();
phpinfo (8);
$phpinfo =ob_get_contents ();
ob_end_clean ();
$phpinfo =strip_tags ($phpinfo );
$phpinfo =stristr ($phpinfo ,"gd version" );
$phpinfo =stristr ($phpinfo ,"version" );
$end =strpos ($phpinfo ," " );
$phpinfo =substr ($phpinfo ,0,$end );
$phpinfo =substr ($phpinfo ,7);
if( version_compare ("2.0" ,"$phpinfo" )== 1)
echo "you have a version less then 2" ;
?>I appears I don't have gd2. My project involves taking user uploaded jpegs and storing them for an online directory. If there's no way to control what version of gd is used by the hosting company I select, then, I am stuck with using imagecreate (not-preferred). I tried using a jpg image on my system but that doesn't work. I get a parse error on the line corresponding to header ("content-type: image/jpg").
sorry for the long post. I presume more detail is better than less. I'm a newbie so pardon if I am missing something obvious.
THANKS in ADVANCE.
Back to top