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 install PDO MySQL pada OS CentOS. Untuk mulai install PDO MySQL, ketikkan command:
yum install php-devel php-pear mysql-devel httpd-devel
[bash]
[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.9-3.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.9-3.el6_0.1.x86_64
--> Processing Dependency: openldap-devel for package: apr-util-devel-1.3.9-3.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.9-3.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: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-15.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.3-3.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.3-3.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.25-16.el6.x86_64
--> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.25-16.el6.x86_64
---> 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.9-22.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.23-20.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-devel-2.0.94-5.2.el6.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.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
libselinux-devel x86_64 2.0.94-5.2.el6 base 136 k
libsepol-devel x86_64 2.0.41-4.el6 base 64 k
mailcap noarch 2.1.31-2.el6 base 27 k
mysql x86_64 5.1.61-1.el6_2.1 updates 881 k
openldap-devel x86_64 2.4.23-20.el6 base 1.1 M
openssl-devel x86_64 1.0.0-20.el6_2.4 updates 1.1 M
php x86_64 5.3.3-3.el6_2.8 updates 1.1 M
php-cli x86_64 5.3.3-3.el6_2.8 updates 2.2 M
php-common x86_64 5.3.3-3.el6_2.8 updates 522 k
pkgconfig x86_64 1:0.23-9.1.el6 base 70 k
zlib-devel x86_64 1.2.3-27.el6 base 44 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
Transaction Test Succeeded
Running Transaction
Installing : 1:pkgconfig-0.23-9.1.el6.x86_64 1/30
Installing : apr-1.3.9-3.el6_1.2.x86_64 2/30
Installing : apr-util-1.3.9-3.el6_0.1.x86_64 3/30
Installing : apr-devel-1.3.9-3.el6_1.2.x86_64 4/30
Installing : php-common-5.3.3-3.el6_2.8.x86_64 5/30
Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 6/30
Installing : httpd-tools-2.2.15-15.el6.centos.1.x86_64 7/30
Installing : zlib-devel-1.2.3-27.el6.x86_64 8/30
Installing : libcom_err-devel-1.41.12-11.el6.x86_64 9/30
Installing : libsepol-devel-2.0.41-4.el6.x86_64 10/30
Installing : libselinux-devel-2.0.94-5.2.el6.x86_64 11/30
Installing : expat-devel-2.0.1-9.1.el6.x86_64 12/30
Installing : cyrus-sasl-devel-2.1.23-13.el6.x86_64 13/30
Installing : openldap-devel-2.4.23-20.el6.x86_64 14/30
Installing : libedit-2.11-4.20080712cvs.1.el6.x86_64 15/30
Installing : php-cli-5.3.3-3.el6_2.8.x86_64 16/30
Installing : mailcap-2.1.31-2.el6.noarch 17/30
Installing : httpd-2.2.15-15.el6.centos.1.x86_64 18/30
Installing : php-5.3.3-3.el6_2.8.x86_64 19/30
Installing : db4-cxx-4.7.25-16.el6.x86_64 20/30
Installing : db4-devel-4.7.25-16.el6.x86_64 21/30
Installing : apr-util-devel-1.3.9-3.el6_0.1.x86_64 22/30
Installing : mysql-5.1.61-1.el6_2.1.x86_64 23/30
Installing : keyutils-libs-devel-1.4-3.el6.x86_64 24/30
Installing : krb5-devel-1.9-22.el6_2.1.x86_64 25/30
Installing : openssl-devel-1.0.0-20.el6_2.4.x86_64 26/30
Installing : mysql-devel-5.1.61-1.el6_2.1.x86_64 27/30
Installing : httpd-devel-2.2.15-15.el6.centos.1.x86_64 28/30
Installing : php-devel-5.3.3-3.el6_2.8.x86_64 29/30
Installing : 1:php-pear-1.9.4-4.el6.noarch 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
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 ~]#
[/bash]
yum install php-pdo
[bash]
[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 | 73 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-pdo-5.3.3-3.el6_2.8.x86_64 1/1
Installed:
php-pdo.x86_64 0:5.3.3-3.el6_2.8
Complete!
[root@linggih ~]#
[/bash]
PHP_PDO_SHARED=1 yum install php-pdo_mysql
[bash]
[root@linggih ~]# PHP_PDO_SHARED=1 yum install php-pdo_mysql
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-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 | 79 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-mysql-5.3.3-3.el6_2.8.x86_64 1/1
Installed:
php-mysql.x86_64 0:5.3.3-3.el6_2.8
Complete!
[root@linggih ~]#
[/bash]
Restart Apache
service httpd restart atau /etc/init.d/httpd restart
[bash collapse="false"]
[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 ~]#
[/bash]
Cek php extention. pdo_mysql (lihat pada baris ke-26)
php -me
[bash highlight="26"]
[root@linggih ~]# php -me
[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 ~]#
[/bash]
Semoga bermanfaat...
:D
Tidak ada komentar:
Posting Komentar