进去到php的源码包的ext中
[root@linux php]# cd /usr/local/src/php-5.4.45/ext/pdo_mysql[root@linux pdo_mysql]# /usr/local/php5/bin/phpize(phpize 命令是用来准备 PHP 外挂模块的编译环境的) Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 [root@linux pdo_mysql]# ./configure --with-php-config=/usr/local/php5/bin/php-config --with-pdo-mysql=/usr/local/mysql (假设你的mysql是安装在/usr/local/mysql)[root@linux pdo_mysql]# make && makeinstallBuild complete.Don't forget to run 'make test'.
提示:Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/
说明就追加编译成功了!
修改php.ini加入
extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so"
或者将
extension_dir = "./"
改为
extension_dir="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525/"
在下面添加
extension = "pdo_mysql.so"