Install PDO MySQL Pada Centos

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Install PDO MySQL Pada Centos

Install PDO MySQL Pada Centos


Apa itu PDO MySQL? PDO adalah singkatan dari PHP Data Objects, berdasarkan wiki mysql.com, PDO adalah
PDO_MYSQL is the MySQL driver for PDO (PHP Data Objects). Under the name PDO_MYSQLND a patch which
allows to compile PDO_MYSQL against the MySQL native driver for PHP (mysqlnd) or the mysql client library
(like ever since) has been developed.
Pada artikel tidak akan mengulas apa itu PDO, namun cara ins tall PDO MySQL pada OS CentOS. Untuk mulai
install PDO MySQL, ketikkan command:
yum install php-devel php-pear mysql-devel httpd-devel
[root@linggih ~]# yum install php-devel php-pear mysql-devel httpd-devel
...
...
--> Processing Dependency: libapr-1.so.0()(64bit) for package: apr-devel-1.3.93.el6_1.2.x86_64
---> Package apr-util-devel.x86_64 0:1.3.9-3.el6_0.1 will be installed
--> Processing Dependency: apr-util = 1.3.9-3.el6_0.1 for package: apr-util-devel-1.3.93.el6_0.1.x86_64
--> Processing Dependency: openldap-devel for package: apr-util-devel-1.3.93.el6_0.1.x86_64
--> Processing Dependency: db4-devel for package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
--> Processing Dependency: expat-devel for package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: apr-util-devel-1.3.93.el6_0.1.x86_64
---> Package httpd.x86_64 0:2.2.15-15.el6.centos.1 will be installed
--> Processing Dependency: httpd-tools = 2.2.15-15.el6.centos.1 for package: httpd2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.1515.el6.centos.1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-15.el6.centos.1.x86_64
---> Package mysql.x86_64 0:5.1.61-1.el6_2.1 will be installed
---> Package openssl-devel.x86_64 0:1.0.0-20.el6_2.4 will be installed
--> Processing Dependency: zlib-devel for package: openssl-devel-1.0.0-20.el6_2.4.x86_64
--> Processing Dependency: krb5-devel for package: openssl-devel-1.0.0-20.el6_2.4.x86_64
---> Package php.x86_64 0:5.3.3-3.el6_2.8 will be installed
--> Processing Dependency: php-common = 5.3.3-3.el6_2.8 for package: php-5.3.33.el6_2.8.x86_64
---> Package php-cli.x86_64 0:5.3.3-3.el6_2.8 will be installed
--> Processing Dependency: libedit.so.0()(64bit) for package: php-cli-5.3.33.el6_2.8.x86_64
---> Package pkgconfig.x86_64 1:0.23-9.1.el6 will be installed
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-3.el6_1.2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package db4-devel.x86_64 0:4.7.25-16.el6 will be installed
--> Processing Dependency: db4-cxx = 4.7.25-16.el6 for package: db4-devel-4.7.2516.el6.x86_64
--> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.2516.el6.x86_64

http://www.linggih.com | Install PDO MySQL Pada Centos 1

Install PDO MySQL Pada Centos


---> Package expat-devel.x86_64 0:2.0.1-9.1.el6 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-15.el6.centos.1 will be installed
---> Package krb5-devel.x86_64 0:1.9-22.el6_2.1 will be installed
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.9-22.el6_2.1.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.922.el6_2.1.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.9-22.el6_2.1.x86_64
---> Package libedit.x86_64 0:2.11-4.20080712cvs.1.el6 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
---> Package openldap-devel.x86_64 0:2.4.23-20.el6 will be installed
--> Processing Dependency: cyrus-sasl-devel >= 2.1 for package: openldap-devel-2.4.2320.el6.x86_64
---> Package php-common.x86_64 0:5.3.3-3.el6_2.8 will be installed
---> Package zlib-devel.x86_64 0:1.2.3-27.el6 will be installed
--> Running transaction check
---> Package cyrus-sasl-devel.x86_64 0:2.1.23-13.el6 will be installed
---> Package db4-cxx.x86_64 0:4.7.25-16.el6 will be installed
---> Package keyutils-libs-devel.x86_64 0:1.4-3.el6 will be installed
---> Package libcom_err-devel.x86_64 0:1.41.12-11.el6 will be installed
---> Package libselinux-devel.x86_64 0:2.0.94-5.2.el6 will be installed
--> Processing Dependency: libsepol-devel >= 2.0.32-1 for package: libselinux-devel2.0.94-5.2.el6.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.945.2.el6.x86_64
--> Running transaction check
---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package
Arch
Version
Repository Size
================================================================================
Installing:
httpd-devel
x86_64
2.2.15-15.el6.centos.1
updates 147 k
mysql-devel
x86_64
5.1.61-1.el6_2.1
updates 127 k
php-devel
x86_64
5.3.3-3.el6_2.8
updates 506 k
php-pear
noarch
1:1.9.4-4.el6
base
393 k
Installing for dependencies:
apr
x86_64
1.3.9-3.el6_1.2
base
123 k
apr-devel
x86_64
1.3.9-3.el6_1.2
base
176 k
apr-util
x86_64
1.3.9-3.el6_0.1
base
87 k
apr-util-devel
x86_64
1.3.9-3.el6_0.1
base
69 k
apr-util-ldap
x86_64
1.3.9-3.el6_0.1
base
15 k
cyrus-sasl-devel
x86_64
2.1.23-13.el6
base
302 k
db4-cxx
x86_64
4.7.25-16.el6
base
590 k
db4-devel
x86_64
4.7.25-16.el6
base
6.6 M
expat-devel
x86_64
2.0.1-9.1.el6
base
119 k
httpd
x86_64
2.2.15-15.el6.centos.1
updates 813 k
httpd-tools
x86_64
2.2.15-15.el6.centos.1
updates
70 k
keyutils-libs-devel
x86_64
1.4-3.el6
base
28 k
krb5-devel
x86_64
1.9-22.el6_2.1
updates 1.2 M
libcom_err-devel
x86_64
1.41.12-11.el6
base
31 k
libedit
x86_64
2.11-4.20080712cvs.1.el6
base
74 k

http://www.linggih.com | Install PDO MySQL Pada Centos 2

Install PDO MySQL Pada Centos


libselinux-devel
libsepol-devel
mailcap
mysql
x86_64
openldap-devel
openssl-devel
php
php-cli
php-common
pkgconfig
zlib-devel

x86_64
2.0.94-5.2.el6
x86_64
2.0.41-4.el6
noarch
2.1.31-2.el6
5.1.61-1.el6_2.1
x86_64
2.4.23-20.el6
x86_64
1.0.0-20.el6_2.4
x86_64
5.3.3-3.el6_2.8
x86_64
5.3.3-3.el6_2.8
x86_64
5.3.3-3.el6_2.8
x86_64
1:0.23-9.1.el6
x86_64
1.2.3-27.el6

updates

base
base
base
881 k
base
updates
updates
updates
updates
base
base

136 k
64 k
27 k
1.1 M
1.1
1.1
2.2
522
70 k
44 k

M
M
M
k

Transaction Summary
================================================================================
Install
30 Package(s)
Total download size: 19 M
Installed size: 64 M
Is this ok [y/N]: y
Downloading Packages:
http://centos.biz.net.id/6.2/os/x86_64/Packages/apr-1.3.9-3.el6_1.2.x86_64.rpm: [Errno
14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
(1/30): apr-1.3.9-3.el6_1.2.x86_64.rpm
| 123 kB
00:00
(2/30): apr-devel-1.3.9-3.el6_1.2.x86_64.rpm
| 176 kB
00:00
(3/30): apr-util-1.3.9-3.el6_0.1.x86_64.rpm
| 87 kB
00:00
(4/30): apr-util-devel-1.3.9-3.el6_0.1.x86_64.rpm
| 69 kB
00:00
(5/30): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm
| 15 kB
00:00
(6/30): cyrus-sasl-devel-2.1.23-13.el6.x86_64.rpm
| 302 kB
00:01
(7/30): db4-cxx-4.7.25-16.el6.x86_64.rpm
| 590 kB
00:02
(8/30): db4-devel-4.7.25-16.el6.x86_64.rpm
| 6.6 MB
00:29
(9/30): expat-devel-2.0.1-9.1.el6.x86_64.rpm
| 119 kB
00:00
(10/30): httpd-2.2.15-15.el6.centos.1.x86_64.rpm
| 813 kB
00:03
(11/30): httpd-devel-2.2.15-15.el6.centos.1.x86_64.rpm
| 147 kB
00:00
(12/30): httpd-tools-2.2.15-15.el6.centos.1.x86_64.rpm
| 70 kB
00:00
(13/30): keyutils-libs-devel-1.4-3.el6.x86_64.rpm
| 28 kB
00:00
(14/30): krb5-devel-1.9-22.el6_2.1.x86_64.rpm
| 1.2 MB
00:05
(15/30): libcom_err-devel-1.41.12-11.el6.x86_64.rpm
| 31 kB
00:00
(16/30): libedit-2.11-4.20080712cvs.1.el6.x86_64.rpm
| 74 kB
00:00
(17/30): libselinux-devel-2.0.94-5.2.el6.x86_64.rpm
| 136 kB
00:00
(18/30): libsepol-devel-2.0.41-4.el6.x86_64.rpm
| 64 kB
00:00
(19/30): mailcap-2.1.31-2.el6.noarch.rpm
| 27 kB
00:00
(20/30): mysql-5.1.61-1.el6_2.1.x86_64.rpm
| 881 kB
00:03
(21/30): mysql-devel-5.1.61-1.el6_2.1.x86_64.rpm
| 127 kB
00:00
(22/30): openldap-devel-2.4.23-20.el6.x86_64.rpm
| 1.1 MB
00:04
(23/30): openssl-devel-1.0.0-20.el6_2.4.x86_64.rpm
| 1.1 MB
00:05
(24/30): php-5.3.3-3.el6_2.8.x86_64.rpm
| 1.1 MB
00:04
(25/30): php-cli-5.3.3-3.el6_2.8.x86_64.rpm
| 2.2 MB
00:09
(26/30): php-common-5.3.3-3.el6_2.8.x86_64.rpm
| 522 kB
00:02
(27/30): php-devel-5.3.3-3.el6_2.8.x86_64.rpm
| 506 kB
00:02
(28/30): php-pear-1.9.4-4.el6.noarch.rpm
| 393 kB
00:01
(29/30): pkgconfig-0.23-9.1.el6.x86_64.rpm
| 70 kB
00:00
(30/30): zlib-devel-1.2.3-27.el6.x86_64.rpm
| 44 kB
00:00
-------------------------------------------------------------------------------Total
228 kB/s | 19 MB
01:23
Running rpm_check_debug
Running Transaction Test

http://www.linggih.com | Install PDO MySQL Pada Centos 3

Install PDO MySQL Pada Centos


Transaction Test Succeeded
Running Transaction
Installing : 1:pkgconfig-0.23-9.1.el6.x86_64
Installing : apr-1.3.9-3.el6_1.2.x86_64
Installing : apr-util-1.3.9-3.el6_0.1.x86_64
Installing : apr-devel-1.3.9-3.el6_1.2.x86_64
Installing : php-common-5.3.3-3.el6_2.8.x86_64
Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64
Installing : httpd-tools-2.2.15-15.el6.centos.1.x86_64
Installing : zlib-devel-1.2.3-27.el6.x86_64
Installing : libcom_err-devel-1.41.12-11.el6.x86_64
Installing : libsepol-devel-2.0.41-4.el6.x86_64
Installing : libselinux-devel-2.0.94-5.2.el6.x86_64
Installing : expat-devel-2.0.1-9.1.el6.x86_64
Installing : cyrus-sasl-devel-2.1.23-13.el6.x86_64
Installing : openldap-devel-2.4.23-20.el6.x86_64
Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64
Installing : php-cli-5.3.3-3.el6_2.8.x86_64
Installing : mailcap-2.1.31-2.el6.noarch
Installing : httpd-2.2.15-15.el6.centos.1.x86_64
Installing : php-5.3.3-3.el6_2.8.x86_64
Installing : db4-cxx-4.7.25-16.el6.x86_64
Installing : db4-devel-4.7.25-16.el6.x86_64
Installing : apr-util-devel-1.3.9-3.el6_0.1.x86_64
Installing : mysql-5.1.61-1.el6_2.1.x86_64
Installing : keyutils-libs-devel-1.4-3.el6.x86_64
Installing : krb5-devel-1.9-22.el6_2.1.x86_64
Installing : openssl-devel-1.0.0-20.el6_2.4.x86_64
Installing : mysql-devel-5.1.61-1.el6_2.1.x86_64
Installing : httpd-devel-2.2.15-15.el6.centos.1.x86_64
Installing : php-devel-5.3.3-3.el6_2.8.x86_64
Installing : 1:php-pear-1.9.4-4.el6.noarch

1/30
2/30
3/30
4/30
5/30
6/30
7/30
8/30
9/30
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30
21/30
22/30
23/30
24/30
25/30
26/30
27/30
28/30
29/30
30/30

Installed:
httpd-devel.x86_64 0:2.2.15-15.el6.centos.1
mysql-devel.x86_64 0:5.1.61-1.el6_2.1
php-devel.x86_64 0:5.3.3-3.el6_2.8
php-pear.noarch 1:1.9.4-4.el6
Dependency Installed:
apr.x86_64 0:1.3.9-3.el6_1.2
apr-devel.x86_64 0:1.3.9-3.el6_1.2
apr-util.x86_64 0:1.3.9-3.el6_0.1
apr-util-devel.x86_64 0:1.3.9-3.el6_0.1
apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1
cyrus-sasl-devel.x86_64 0:2.1.23-13.el6
db4-cxx.x86_64 0:4.7.25-16.el6
db4-devel.x86_64 0:4.7.25-16.el6
expat-devel.x86_64 0:2.0.1-9.1.el6
httpd.x86_64 0:2.2.15-15.el6.centos.1
httpd-tools.x86_64 0:2.2.15-15.el6.centos.1
keyutils-libs-devel.x86_64 0:1.4-3.el6
krb5-devel.x86_64 0:1.9-22.el6_2.1
libcom_err-devel.x86_64 0:1.41.12-11.el6
libedit.x86_64 0:2.11-4.20080712cvs.1.el6
libselinux-devel.x86_64 0:2.0.94-5.2.el6
libsepol-devel.x86_64 0:2.0.41-4.el6
mailcap.noarch 0:2.1.31-2.el6
mysql.x86_64 0:5.1.61-1.el6_2.1
openldap-devel.x86_64 0:2.4.23-20.el6

http://www.linggih.com | Install PDO MySQL Pada Centos 4

Install PDO MySQL Pada Centos


openssl-devel.x86_64 0:1.0.0-20.el6_2.4
php.x86_64 0:5.3.3-3.el6_2.8
php-cli.x86_64 0:5.3.3-3.el6_2.8
php-common.x86_64 0:5.3.3-3.el6_2.8
pkgconfig.x86_64 1:0.23-9.1.el6
zlib-devel.x86_64 0:1.2.3-27.el6
Complete!
[root@linggih ~]#

yum install php-pdo


[root@linggih ~]# yum install php-pdo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* extras: centos.biz.net.id
* updates: centos.idrepo.or.id
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.3-3.el6_2.8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package
Arch
Version
Repository
Size
================================================================================
Installing:
php-pdo
x86_64
5.3.3-3.el6_2.8
updates
73 k
Transaction Summary
================================================================================
Install
1 Package(s)
Total download size: 73 k
Installed size: 168 k
Is this ok [y/N]: y
Downloading Packages:
php-pdo-5.3.3-3.el6_2.8.x86_64.rpm
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-pdo-5.3.3-3.el6_2.8.x86_64

73 kB

00:00

1/1

Installed:
php-pdo.x86_64 0:5.3.3-3.el6_2.8
Complete!
[root@linggih ~]#

PHP_PDO_SHARED=1 yum install php-pdo_mysql


[root@linggih ~]# PHP_PDO_SHARED=1 yum install php-pdo_mysql
Loaded plugins: fastestmirror

http://www.linggih.com | Install PDO MySQL Pada Centos 5

Install PDO MySQL Pada Centos


Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* extras: centos.biz.net.id
* updates: centos.idrepo.or.id
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-3.el6_2.8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package
Arch
Version
Repository
Size
================================================================================
Installing:
php-mysql
x86_64
5.3.3-3.el6_2.8
updates
79 k
Transaction Summary
================================================================================
Install
1 Package(s)
Total download size: 79 k
Installed size: 215 k
Is this ok [y/N]: y
Downloading Packages:
php-mysql-5.3.3-3.el6_2.8.x86_64.rpm
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-mysql-5.3.3-3.el6_2.8.x86_64

79 kB

00:00

1/1

Installed:
php-mysql.x86_64 0:5.3.3-3.el6_2.8
Complete!
[root@linggih ~]#

Restart Apache
service httpd restart atau /etc/init.d/httpd restart
[root@linggih ~]# service httpd restart
Stopping httpd:
[ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain
name, using linggih.sytes.net for ServerName
[ OK ]
[root@linggih ~]#

Cek php extention. pdo_mysql (lihat pada baris ke-26)


php -me
[root@linggih ~]# php -me

http://www.linggih.com | Install PDO MySQL Pada Centos 6

Install PDO MySQL Pada Centos


[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
gmp
hash
iconv
json
libxml
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
xml
zip
zlib
[Zend Modules]
[root@linggih ~]#

Semoga bermanfaat

Article Source:
http://l i nggi h. com/u ni x/ uni x -os /ce ntos /i ns t al l -pdo -my s ql -pa da -ce ntos /

http://www.linggih.com | Install PDO MySQL Pada Centos 7

You might also like