How do I install PHP GD Library on CentOS 6.5 x32

April 30, 2014 29.8k views
Hello, I am quite new to setting up and configuring web servers and I can't seem to figure this out. I am trying to install the PHP GD library on my machine, but I get an error I don't know how to solve. I executed the command : sudo yum install php-gd And got the following: Error: Package: php-gd-5.3.3-27.el6_5.i686 (updates) Requires: php-common(x86-32) = 5.3.3-27.el6_5 Installed: php-common-5.4.27-1.el6.remi.i686 (@remi) php-common(x86-32) = 5.4.27-1.el6.remi Available: php-common-5.3.3-26.el6.i686 (base) php-common(x86-32) = 5.3.3-26.el6 Available: php-common-5.3.3-27.el6_5.i686 (updates) php-common(x86-32) = 5.3.3-27.el6_5 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest Also, I used the following repositories: sudo rpm -Uvh sudo rpm -Uvh Any ideas about how to solve this? Thanks a lot in advance!
5 Answers
It looks like the "Remi" third party repository you added has a newer version of php, but not a corresponding version of php-gd. You have php 5.4 installed, but only php-gd 5.3 is available.
Hi, I finally managed to install php-gd, although I'm still not able to make it work.

If I run the command: rpm -qa | grep php

I get the following:

So I'm guessing it should be installed.

I also added a swap file:

Command: swapon -s
Filename Type Size Used Priority
/swapfile file 524280 0 -1

I restarted nginx and there is still no sign of gd when in run phpinfo(). Any ideas why this is happening?

Thanks in advance!
You might need to restart php-fpm for it to take effect:

/etc/rc.d/init.d/php-fpm restart
It worked! thank you so much!

use this link to download rpm .
install that rpm into ur centos mechine
Then yum install php-gd
restart httpd using service httpd restart

Problem relating gd shoul be solved


Have another answer? Share your knowledge.