Configure PHP to have GD Library support

What is the GD library? GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD creates PNG, JPEG and GIF images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve website development.


Two way installation


1. Source installation


yum install php-gd

yum install gd-devel


in order to enable gd library you may edit php.ini and uncomment





You may also have to correct the extension directory setting from:

extension_dir = “./”


extension_dir = “./extensions”



2. Native Installation



./configure \

–with-apxs2=/usr/local/apache/bin/apxs \

–with-mysql=/usr/bin/mysql \

–prefix=/usr/local/apache/php \

–with-config-file-path=/usr/local/apache/php \

–enable-force-cgi-redirect \

–disable-cgi \

–with-zlib \

–with-gettext \

–with-gdbm \

–enable-zip \

–with-gd \

–with-jpeg-dir=/usr/lib/ \

–with-png-dir=/usr/lib/ \



B. make

C. make install


verfiy it by making a file phpinfo.php

vi phpinfo.php and put





restart apache and verify if gd is enabled on the page.


Mag-iwan ng Tugon

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Baguhin )

Twitter picture

You are commenting using your Twitter account. Log Out / Baguhin )

Facebook photo

You are commenting using your Facebook account. Log Out / Baguhin )

Google+ photo

You are commenting using your Google+ account. Log Out / Baguhin )

Connecting to %s