Difference between revisions of "How to Install GD for PHP on CentOS 6"

From Acenet Knowledgebase
Jump to: navigation, search
Line 24: Line 24:
 
gd
 
gd
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
[[Category: CentOS 5]] [[Category: PHP]]

Revision as of 18:11, 4 December 2012

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:

[root@vps ~]# php -m | grep -i gd
gd