How to Install GD for PHP on CentOS 6

From Acenet Knowledgebase
Jump to: navigation, search

GD is a graphics library available for PHP. It gives PHP the ability to create GIF, PNG, JPEG, WBMP, and XPM image formats. GD can even output image streams directly to a browser. On CentOS 6, GD is available as an RPM and can easily be installed with yum.

Installing GD

To install GD on CentOS 6, simply run:

yum install gd-php

Restart your Web Server

After installing GD, restart your web server. Assuming you're running Apache, you can run:

/etc/init.d/httpd restart

Confirm GD is Installed

You can list available PHP modules to confirm GD was successfully installed:

php -m | grep -i gd

Here's example output showing GD has been installed:

[[email protected] ~]# php -m | grep -i gd
gd