PDA

View Full Version : problem in draw image


etron_neo
Fri 4th Oct '02, 6:13am
hi...

i have problem in drawing image in php...

here is the script:

Header("Content-Type: image/gif");

$im = ImageCreate(500, 75);
$red = ImageColorAllocate($im, 255, 0, 0);

ImageFill($im, 100, 100, $red);
ImageGIF($im);


but when i try on my computer (localhost), i get this:

Fatal error: Call to undefined function: imagecreate() in c:\apache\htdocs\php\examproject\drawimage.php


i have check my php.ini file, and it has the php_gd.dll in there...
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
;extension=php_gd.dll
and some others dll files...

and here is the httpd.conf for the apache server:
LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c

i'm running Apache HTTP Server Version 1.3, PHP Version 4.1.2 on Windows XP Home Edition

Scott MacVicar
Fri 4th Oct '02, 7:36am
you need to remove the semi colon before it as this comments out.

Do that then restart apache / IIS.

etron_neo
Sun 6th Oct '02, 10:26pm
previous error solved... but this one came out...

Warning: ImageGif: No GIF create support in this PHP build in c:\apache\htdocs\php\examproject\drawimage.php on this line, ImageGIF($im);


is this mean that the dll doesn't support gif?

Scott MacVicar
Sun 6th Oct '02, 10:58pm
gif isn't valid any more since its owned by Compuserve and you would require a license to use it, use png or jpeg instead.

etron_neo
Mon 7th Oct '02, 3:27am
thanks for your help...

it works fine now... on jpeg images