PDA

View Full Version : GD Library error - undefined function imageantialias


plathw
9th September 2008, 17:00
I am getting the following error that I believe tells me that GD Library is not working properly:

Fatal error: Call to undefined function imageantialias() in /var/www/web40/web/cap.php on line 51

I am running Ubuntu with ISPconfig. I checked my phpinfo and GD library shows the following:

GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.10
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

Any ideas on what could be going on?

Ben
9th September 2008, 18:11
The only hint the php doc's give, that this function only exists with the bundled version of GD, so I'd guess this is not the "bundled" one.

Does
var_dump( function_exists('imageantialias'));
return false?

Also
var_dump( function_exists('imagecreatetruecolor'));
should return false is it is another "truecolorimageonly" function.

plathw
9th September 2008, 21:34
That should be the GD bundled with ubuntu, but I'm not 100% sure.

How would I run those? Sorry, kind of a noob here.

falko
10th September 2008, 17:37
How would I run those? Sorry, kind of a noob here.
You can put them in a PHP script, e.g. like this:

<?php

if (false === var_dump( function_exists('imageantialias'))) echo 'error1';
if (false === var_dump( function_exists('imagecreatetruecolor'))) echo 'error2';
?>

falko
10th September 2008, 18:00
This post from Ben (should be post #4 in this thread) got lost today because of a server failure. I apologize and add it again for the sake of completeness:

np ;)

just open your shell and type the following:

php -r "var_dump( function_exists('imageantialias'));"
and
php -r "var_dump( function_exists('imagecreatetruecolor'));"

That should for my expectiation output both true or both false.

plathw
18th September 2008, 22:40
You can put them in a PHP script, e.g. like this:

<?php

if (false === var_dump( function_exists('imageantialias'))) echo 'error1';
if (false === var_dump( function_exists('imagecreatetruecolor'))) echo 'error2';
?>

Here is the output:
bool(false) bool(true)

falko
19th September 2008, 18:25
So the imageantialias does not exist. Which distribution are you using, and how exactly did you install PHP?

plathw
22nd September 2008, 19:41
I did the Ubuntu/ISPconfig perfect set up here:

http://www.howtoforge.org/perfect_setup_ubuntu_6.06

falko
23rd September 2008, 21:24
It seems you must compile PHP yourself:
http://ubuntuforums.org/archive/index.php/t-203376.html
http://ubuntuforums.org/showthread.php?t=506801

But you can also try this:
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/74647/comments/6