[root@localhost src]#tar zxvf PDO_MYSQL-1.0.2.tgz 3、配置和编译文件[root@localhost src]cd PDO_MYSQL-1.0.2 [root@localhost MYSQL-1.0.2]/usr/local/php/bin/phpize [root@localhost MYSQL-1.0.2]./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql/ --with-zlib-dir=/usr/local/lib [root@localhost MYSQL-1.0.2]make install注:我的PHP安装在: /usr/local/php/ mysql安装在: /usr/local/mysql编译的时候注意你自己的安装目录在哪里#切换目录,查看pdo_mysql.so是否存在[root@localhost MYSQL-1.0.2]cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ #编辑php.ini [root@localhost MYSQL-1.0.2]vi /usr/local/php/etc/php.ini #添加pdo_mysql扩展extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so或者extension=pdo_mysql.so #重启apache [root@localhost MYSQL-1.0.2]/usr/local/apache2/bin/apachectl restart