Page 1 of 1

GD Library

Posted: Mon Apr 14, 2003 8:51 am
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

Posted: Mon Apr 14, 2003 5:29 pm
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.

Posted: Tue Apr 15, 2003 3:57 am
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

Posted: Tue Apr 15, 2003 10:26 am
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.