pdo_mysql
http://pecl.php.net/package/PDO_MYSQL
Linux下PHP扩展pdo_mysql
1.进入PHP源码包ext/pdo目录
# tar zxf PDO_MYSQL-1.0.2.tgz
# cd PDO_MYSQL-1.0.2
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --enable-pdo --with-pdo-sqlite --
with-pdo-mysql=/usr/local/mysql/bin/mysql_config
# make && make install
成功则出现
Installing shared extensions: /usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/
说明在/usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/目录下生成了pdo.so文件
# vi /usr/local/php/etc/php.ini (在末尾添加)
[pdo-mysql]
extension=”/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo.so”
:wq
重启apache
/usr/local/apache/bin/apachectl restart
用test.php(即 <? phpinfo(); ?>)页面可以查看
附:
php5.1及以上版本是自带PDO的,只要在php安装时带上--with-pdo-
mysql=/usr/local/mysql/bin/mysql_config即可。
本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/835026如需转载请自行联系原作者
yangzhimingg