《运维--PlayBook》更新中.......!请访问: https://ops.cnmysql.com
pdo_mysql模块安装
如果没有安装pdo模块的需要先安装pdo模块,不然在编译pdo_mysql模块的时候会报如下错误:
configure: error: Cannot find php_pdo_driver.h.
1、进入源码模块目录编译pdo模块
cd /home/soft/nginx/php-5.5.14/ext/pdo
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
2、编译pdo_mysql
cd /home/soft/nginx/php-5.5.14/ext/pdo_mysql
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
编译完后vi php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/pdo_mysql.so
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/pdo.so
重启php-fpm
/etc/init.d/php-fpm restart
php -m 查看php的模块
或者:/usr/local/webserver/php/bin/php -r "phpinfo();"|grep -i pdo_mysql