Help with Imagefilled functions (call to undefined function)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jon2003
Forum Newbie
Posts: 7
Joined: Tue Apr 29, 2003 7:44 pm

Help with Imagefilled functions (call to undefined function)

Post 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); 
?>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
Jon2003
Forum Newbie
Posts: 7
Joined: Tue Apr 29, 2003 7:44 pm

Post by Jon2003 »

You are right, the line "extension=php_gd2.dll" fixed all my current problems. Thank you very much :D
Post Reply