Linux – Install GD Library for PHP in GoDaddy VPS with CentOS??

apache-2.2centosgdlinux

When I tried to install php-gd library in my GoDaddy VPS with CentOS, It gives:

$ yum install php-gd
Loaded plugins: fastestmirror
Determining fastest mirrors
addons                                                    | 951 B     00:00
base                                                      | 2.1 kB     00:00
extras                                                    | 2.1 kB     00:00
update                                                    | 1.9 kB     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package php-gd available.
Nothing to do 

Best Answer

This is the command that failed:

yum --exclude=kernel* -y install gettext automake19 libpng-devel openssl libpng-dev zlib-devel autoconf261 libidn-devel gmake libidn libXpm openssl-devel automake coreutils patch libstdc++-dev libltdl3-devel libltdl libopenssl0.9.7-static-devel libtool-ltdl-devel libXpm-devel sed libXpm-dev lsof krb5-dev flex glibc-dev expat-dev krb5-devel xorg-x11-devel libtool-ltdl libssl-dev pam-devel libopenssl0-devel zlib1-devel expat-devel libopenssl0-dev glibc-devel expat gcc-c++ zlib libstdc++ bison libstdc++-devel libjpeg-devel libtool-libltdl-devel libtool openssl-dev libopenssl0 libz-devel libjpeg-dev pam-dev fileutils libltdl-devel libopenssl0.9.7-devel e2fsprogs-devel ca_root_nss make libX11-devel libstdc++-devel.x86_64 gd cpp xorg-x11-dev gcc ssl-dev autoconf lex

Since EasyApache was unable to resolve it automatically you should:
1) Manually run the failed YUM command (shown above) via SSH
2) See if your particular error is addressed at http://www.cpanel.net/support/could_not_ensurepkgs.htm
3) Resolve the YUM problem manually
4) Re-run EasyApache

When running that command as suggested by the output above, you would see openssl conflicts between the i386 and i686 packages:

Transaction Check Error:
package openssl-0.9.8e-12.el5_5.7.i686 is already installed file /lib/.libcrypto.so.0.9.8e.hmac from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386 file /lib/.libssl.so.0.9.8e.hmac from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386 file /lib/libcrypto.so.0.9.8e from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386 file /lib/libssl.so.0.9.8e from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386 file /usr/bin/openssl from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386 file /usr/lib/openssl/engines/lib4758cca.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package ( ... )

To fix this for you, I ran this command:

# rpm -e --nodeps --justdb openssl.i386

Next, I ran the yum command again, and it was successful.

Finally, I ran /scripts/easyapache, and it is running now. When complete, there will be support for the gd php module.