Fatal error: Call to undefined function: imagecreate()

Your PHP installation does not have the GD Library installed or it is not enabled.

The GD Library is bundled with PHP, but needs to be enabled during installation.

You will need Administrator rights to your server to enable the GD Library. If you do not have Administrator access, please contact your support and ask them to enable it for you.

It is recommended that your GD Library version is later than gd-2.0.28. Versions older than gd-2.0.28 may not have GIF support. Versions lower than 2 do not support true color images.

=======================================
Linux / Unix – Administrators (root access)
=======================================
Your PHP would need to be compiled with the GD Library.

Here is a quote from http://www.php.net/gd

"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 (which was first bundled in PHP 4.3.0), use the configure option –with-gd. GD library requires libpng and libjpeg to compile."

Please refer to the PHP manual / installation instructions for more info.

It is also possible to get pre-compiled binaries of PHP with the GD Library built in.

On some systems, you will be able to install by simply typing this in:

yum install gd php-gd

=======================================
Windows users – Administrators
=======================================

If you are hosting on Windows and have Administrator access, you can easily enable the GD Library that is distributed with PHP.

Please see PHP the documentation to learn how to enable extensions in Windows.

Roughly, here is what you need to do:

1. Copy the file php_gd2.dll from your PHP's ext/ directory to where
you have your php extensions. (No need to copy if php_gd2.dll is in the extension
dir already. Look in php.ini for 'extension_dir' directive to
find what is your current extension directory)

2. Modify your php.ini and change the following line:

;extension=php_gd2.dll

to:

extension=php_gd2.dll

3. Restart your web server.

Posted in Technical Support.

Leave a Reply