CentOS: Enabling GD Support in a PHP Installation

How do I enable GD support in a CentOS installation?

+43
linux php cakephp gd centos
Jan 26 '12 at 20:35
source share
5 answers

The thing that did the trick for me in the end was:

yum install gd gd-devel php-gd 

and then restart apache:

 service httpd restart 
+100
Aug 19 2018-12-12T00:
source share
  • You need to find a repo that offers a GD library that matches your current php version. I had great success using Remi for a Coli replica for this purpose. In fact, I used it yesterday to upgrade my php installation to the latest version 5.4.0RC6 in my CentOS6 window.
  • Once you set up the repo just execute sudo yum install php-gd
  • Of course, the usual things apply: make sure you restart apache after installation, etc.
+33
Jan 26 2018-12-12T00:
source share

With CentOS 6.5+ and PHP 5.5:

 yum install php55u-gd service httpd restart 

If you receive an error message: cannot map zero-fill pages: Cannot allocate memory in Unknown on line 0 , this may be due to the fact that you do not have a swap file. I suggest you take a look at the tutorial mentioned in this answer: https://stackoverflow.com>

Tutorial: https://www.digitalocean.com/community/articles/how-to-add-swap-on-centos-6

+6
Apr 10 '14 at 9:57 on
source share

CentOs 6.5+ and PHP 5.6:

 sudo yum install php56-gd service httpd restart 
+4
Jun 30 '16 at 7:44
source share

Enter command

 yum install php-gd 

and reboot the server (httpd, nginx, etc.)

 service httpd restart 
0
Dec 26 '17 at 19:26
source share



All Articles