GD Library

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
abdul
Forum Newbie
Posts: 24
Joined: Thu Nov 14, 2002 7:35 am

GD Library

Post by abdul »

Hi..

I have an installation of PHP 4.3.1 on FreeBSD Server. The PHP documentation says "GD Library" is there with it by default and we don't need to configure it manually. But, when I try any image functions it fails and gives this message
Fatal error: Call to undefined function: imagecreatefrompng() in /usr/home/myweb/www/gd.php on line 4.
Does anybody know what the problem is..? Do I need to make any changes is configuration and re-compile it..?. Thanks in advance.

-Abdul
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

php.ini wrote: extension="php_gd.dll"
Correct me if i'm wrong, but this line needs to be in your php.ini file.

There is more information @ this site.
abdul
Forum Newbie
Posts: 24
Joined: Thu Nov 14, 2002 7:35 am

Post by abdul »

Thanks for that. But, I think that (DLL files) is for a windows version of PHP. What I have is a FreeBSD (UNIX) installation.

Many Thanks
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

oops. :wink:
Installation
To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled version of the GD library configure --with-gd. In Windows you'll include php_gd2.dll as an extension in php.ini. There is also php_gd.dll for GD1 but it's not preferred.

Enhance the capabilities of GD to handle more image formats by specifying the --with-XXXX configure switch to your PHP configure line.
Here is the offical GD manual.
Post Reply