Page 1 of 1

Help with Imagefilled functions (call to undefined function)

Posted: Tue Apr 29, 2003 7:44 pm
by Jon2003
I have just downloaded the latest php yesterday (so hope the latest GD). I try some image functions such as imagecreate, imagecreatefrompng, imageline, imagefilledrectangle. They work well.

However, when I try some other imagefilled such as imagefilledellipse, imagefilledarc, they don't work and there are error messages, e.g., "Call to undefined function: imagefilledellipse()".

Could someone help me to solve this problem? Many thanks in advance.

PS:
The problem accurs on my machines (localhost) only. I have just tried my program on my site and everything seems be ok. BTW, I still need to fix problem to develop on my machines. Here is more information:
- OS: Windows (one machine WinXP, one Win2k)
- MySQL 1.4
- Before: PHP 4.2.2
- New donwload: PHP 4.3.1 zip package

A very simple program I have tried (copy from an old post):

Code: Select all

<?php 
$im = imagecreate(500, 500); 
$background = imagecolorallocate($im, 0xAF, 0xAF, 0xAF); 
$black = imagecolorallocate($im, 0, 0, 0); 
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); 

$g1 = imagecolorallocate($im, 128, 128, 128); 

for ($i=360; $i!=0; $i-=10) 
   imagefilledarc($im, 250, 250, 200, 100, $i-5, $i, $g1, IMG_ARC_PIE); 

imagearc($im, 250, 250, 200, 100, 0, 360, $black); 
imagearc($im, 250, 250, 200, 100, 0,  45, $white); 

header ("Content-type: image/png"); 
imagepng($im); 
?>

Posted: Wed Apr 30, 2003 2:26 pm
by volka
did you enable the extension in your php.ini?

Code: Select all

extension=php_gd.dll
or

Code: Select all

extension=php_gd2.dll
without a leading ; in that line

Code: Select all

<?php phpinfo(); ?>
will tell you more about your configuration

Posted: Wed Apr 30, 2003 8:25 pm
by Jon2003
You are right, the line "extension=php_gd2.dll" fixed all my current problems. Thank you very much :D