转自http://www.2cto.com/os/201404/291403.html
进去到php的源码包的ext中
[root@linux php]# cd /usr/local/src/php-5.2.17/ext/pdo_mysql
[root@linux pdo_mysql]# /usr/local/php/bin/phpize(phpize 命令是用来准备 PHP 外挂模块的编译环境的)
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
[root@linux pdo_mysql]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql (假设你的mysql是安装在/usr/local/mysql)
[root@linux pdo_mysql]# make && makeinstall
。。。。。。。。。。
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
修改php.ini加入
extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so"
重启apache apachectl restart
phpinfo中有pdo_mysql了