Install Php-GD pada Centos 5

Tang ting tung..
hari ini mencoba nginstall php-gd berdasarkan request mitra yang lagi nginstall suatu aplikasi nan butuh fitur gambar di aplikasinya tersebut.
sempat muter2 gak karuan gara2.. ada error yang saya (dan senior saya) gak ngerti apa sebabnya.. coba-coba kami hapus si file terkait, eh berhasil deh nginstall nya.. barangkali ada yang akan mengalami nya suatu hari..jadi saya posting disini pengalaman indah tsb.. sampai detik ini pun saya gak ngerti apa sebenarnya yg mmbuat error tsb..dugaan sementara, mungkin ada sebuah repos yg dijadikan referensi oleh yum untuk di update, sementara repos tsb sebenarnya tidak mengandung paket gd yang perlu kami install sehingga update modul dinyatakan gagal. atau ilustrasinya seperti ini :
saya mau update fitur jpg pada BB, sementara si aplikasi yum nyarinya bukan di toko BB tetapi di gerai Iphone sehingga dia tak kunjung nemu tuh fitur jpg pada BB..bgituh… detailnya..saya lampirkan tahapan installasi php gd yg saya alami hari ini :

1. ketik :yum install php-gd
respon :
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: centos.biz.net.id
* extras: centos.biz.net.id
* updates: centos.biz.net.id
http://repos.zend.com/isv/rpm/pe/noarch/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: ISV. Please verify its path and try again


2. dugaan pertama : mungkin ruting nya error.
cek ruting dg cara ping mbah google..
respon :
PING google.com (209.85.175.147) 56(84) bytes of data.
64 bytes from nx-in-f147.1e100.net (209.85.175.147): icmp_seq=1 ttl=55 time=28.7 ms
64 bytes from nx-in-f147.1e100.net (209.85.175.147): icmp_seq=2 ttl=55 time=28.4 ms
64 bytes from nx-in-f147.1e100.net (209.85.175.147): icmp_seq=3 ttl=55 time=28.3 ms

— google.com ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2532ms
rtt min/avg/max/mdev = 28.350/28.485/28.703/0.249 ms


3.it means koneksi OK, berarti ruting gak masalah. Coba test aplikasi yum dl,,mungkin settingan nya error.
Caranya ketik : yum search mysql (gak ngupdate, cuman cari file nya ada ga di repository). Hasilnya :
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.centos.org
* base: centos.biz.net.id
* extras: centos.biz.net.id
* updates: centos.biz.net.id
http://repos.zend.com/isv/rpm/pe/noarch/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: ISV. Please verify its path and try again

[masih sama euy..sama persis kyk ngupdate..padahal kan cuma search]
4. dugaan kedua : ada yg salah dg librari/repository nya..
terus yang dilakukan adalah masuk ke repositorinya yum..biasanya di /etc/yum.repos.d
saya intip..isinya ada 3 file.. 2 standard..1 nya lagi tampak seperti nama sebuah web server.. 3 file tsb adalah :
1.CentOS-Base.repo
2.CentOS-Media.repo
3.zend.repo

ohya.. si error message kan tadi nyebut2 tuh om zend.. kyknya nih repository deh yg bikin weird [pencerahan a.k.a hidayah datang] ..okeh..kita pindahin aja dl file nya biar gak dibaca sbagai repository..,dan hasilnya…tereteng…bingo!!!

[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Media.repo zend.repo
[root@localhost yum.repos.d]# php -v
PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:18)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Media.repo zend.repo
[root@localhost yum.repos.d]# vi zend.repo
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Media.repo zend.repo
[root@localhost yum.repos.d]# mv zend.repo /etc/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Media.repo
[root@localhost yum.repos.d]# yum install php-gd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* extras: centos.biz.net.id
* updates: centos.biz.net.id
addons | 951 B 00:00
addons/primary | 204 B 00:00
base | 1.1 kB 00:00
base/primary | 1.2 MB 00:00
base 3566/3566
extras | 2.1 kB 00:00
extras/primary_db | 161 kB 00:00
updates | 1.9 kB 00:00
updates/primary_db | 366 kB 00:00
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package php-gd.x86_64 0:5.1.6-27.el5_5.3 set to be updated
–> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-gd
–> Running transaction check
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-pdo
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-pgsql
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-cli
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-ldap
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-odbc
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-mysql
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php
—> Package php-common.x86_64 0:5.1.6-27.el5_5.3 set to be updated
–> Running transaction check
–> Processing Dependency: php = 5.1.6-23.2.el5_3 for package: php-devel
—> Package php.x86_64 0:5.1.6-27.el5_5.3 set to be updated
—> Package php-cli.x86_64 0:5.1.6-27.el5_5.3 set to be updated
—> Package php-ldap.x86_64 0:5.1.6-27.el5_5.3 set to be updated
—> Package php-mysql.x86_64 0:5.1.6-27.el5_5.3 set to be updated
—> Package php-odbc.x86_64 0:5.1.6-27.el5_5.3 set to be updated
—> Package php-pdo.x86_64 0:5.1.6-27.el5_5.3 set to be updated
—> Package php-pgsql.x86_64 0:5.1.6-27.el5_5.3 set to be updated
–> Running transaction check
—> Package php-devel.x86_64 0:5.1.6-27.el5_5.3 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
php-gd x86_64 5.1.6-27.el5_5.3 base 118 k
Updating for dependencies:
php x86_64 5.1.6-27.el5_5.3 base 2.3 M
php-cli x86_64 5.1.6-27.el5_5.3 base 2.2 M
php-common x86_64 5.1.6-27.el5_5.3 base 153 k
php-devel x86_64 5.1.6-27.el5_5.3 base 503 k
php-ldap x86_64 5.1.6-27.el5_5.3 base 38 k
php-mysql x86_64 5.1.6-27.el5_5.3 base 89 k
php-odbc x86_64 5.1.6-27.el5_5.3 base 54 k
php-pdo x86_64 5.1.6-27.el5_5.3 base 66 k
php-pgsql x86_64 5.1.6-27.el5_5.3 base 70 k

Transaction Summary
=============================================================================================================================
Install 1 Package(s)
Update 9 Package(s)
Remove 0 Package(s)

Total download size: 5.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/10): php-ldap-5.1.6-27.el5_5.3.x86_64.rpm | 38 kB 00:00
(2/10): php-odbc-5.1.6-27.el5_5.3.x86_64.rpm | 54 kB 00:00
(3/10): php-pdo-5.1.6-27.el5_5.3.x86_64.rpm | 66 kB 00:00
(4/10): php-pgsql-5.1.6-27.el5_5.3.x86_64.rpm | 70 kB 00:00
(5/10): php-mysql-5.1.6-27.el5_5.3.x86_64.rpm | 89 kB 00:00
(6/10): php-gd-5.1.6-27.el5_5.3.x86_64.rpm | 118 kB 00:00
(7/10): php-common-5.1.6-27.el5_5.3.x86_64.rpm | 153 kB 00:00
(8/10): php-devel-5.1.6-27.el5_5.3.x86_64.rpm | 503 kB 00:00
(9/10): php-cli-5.1.6-27.el5_5.3.x86_64.rpm | 2.2 MB 00:00
(10/10): php-5.1.6-27.el5_5.3.x86_64.rpm | 2.3 MB 00:00
—————————————————————————————————————————–
Total 126 kB/s | 5.6 MB 00:45
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
base/gpgkey | 1.5 kB 00:00
Importing GPG key 0xE8562897 “CentOS-5 Key (CentOS 5 Official Signing Key) ” from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : php-common 1/19
warning: /etc/php.ini created as /etc/php.ini.rpmnew
Updating : php-pdo 2/19
Updating : php-cli 3/19
Updating : php 4/19
Installing : php-gd 5/19
Updating : php-devel 6/19
Updating : php-mysql 7/19
Updating : php-ldap 8/19
Updating : php-pgsql 9/19
Updating : php-odbc 10/19
Cleanup : php 11/19
Cleanup : php-cli 12/19
Cleanup : php-devel 13/19
Cleanup : php-mysql 14/19
Cleanup : php-common 15/19
Cleanup : php-ldap 16/19
Cleanup : php-pgsql 17/19
Cleanup : php-odbc 18/19
Cleanup : php-pdo 19/19

Installed:
php-gd.x86_64 0:5.1.6-27.el5_5.3

Dependency Updated:
php.x86_64 0:5.1.6-27.el5_5.3 php-cli.x86_64 0:5.1.6-27.el5_5.3 php-common.x86_64 0:5.1.6-27.el5_5.3
php-devel.x86_64 0:5.1.6-27.el5_5.3 php-ldap.x86_64 0:5.1.6-27.el5_5.3 php-mysql.x86_64 0:5.1.6-27.el5_5.3
php-odbc.x86_64 0:5.1.6-27.el5_5.3 php-pdo.x86_64 0:5.1.6-27.el5_5.3 php-pgsql.x86_64 0:5.1.6-27.el5_5.3

Complete!
[root@localhost yum.repos.d]# rpm -qa | grep php
php-gd-5.1.6-27.el5_5.3
php-ldap-5.1.6-27.el5_5.3
php-cli-5.1.6-27.el5_5.3
php-mysql-5.1.6-27.el5_5.3
php-pear-1.4.9-6.el5
php-pdo-5.1.6-27.el5_5.3
php-devel-5.1.6-27.el5_5.3
php-odbc-5.1.6-27.el5_5.3
php-common-5.1.6-27.el5_5.3
php-pgsql-5.1.6-27.el5_5.3
php-5.1.6-27.el5_5.3

terus..setelah beres nginstall dan restart web server nya.. jalan deh tuh modul php-gd..
horeeeee….alhamdulillah…bahagia tak terkira..
dan bisa posting panjang jg akhirnya 😛

Advertisements