Warmly recommended: Super Multi IT resources, all in 798 Resource Network
(A,)
first- http://pecl.php.net/ search pdo_mysql
(II)
to find the required version, I use the stable version.
First look at the instructions, especially pay attention to the version of php mysql.
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
the tar-1.0.2.tgz xzvf pdo_mysql
CD-1.0.2 pdo_mysql
/ usr / local / PHP / bin / the phpize
(III)
even if we do not follow the install mysql service, but also have to install mysql client mysql-devel; otherwise mysql.h not find the head, resulting in an error.
yum install mysql-devel
(IV)
corrected the header file location
ln -s / usr / include / mysql / * / usr / local / include /
(五、)
检测编译
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr
(六、安装)
make && make install
(七、)
修改 php.ini
extension=/data/openresty/php/lib/php/extensions/no-debug-non-zts-20121212/pdo_mysql.so