linux下php安装pdo_mysql扩展
[root@localhost /]# cd /lamp/php-5.2.6/ext/pdo_mysql
[root@localhost pdo_mysql]#
[root@localhost pdo_mysql]# pwd
/lamp/php-5.2.6/ext/pdo_mysql
[root@localhost pdo_mysql]#
2.假设你的php是安装在/usr/local/php里的。执行/usr/local/php/bin/phpize ,运行命令:
[root@localhost pdo_mysql]# /usr/local/php5/bin/phpize
3.进行编译。./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql (假设你的mysql是安装在/usr/local/mysql)
[root@localhost pdo_mysql]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
4.编译安装。make,make install
[root@localhost pdo_mysql]# make && make install;
5.编译后,在/usr/local/php/lib/php/extensions里就会多了个no-debug-non-zts-20060613文件夹,它里面就生成了一个pdo_mysql.so,修改php.ini,加入扩展语句
extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/";
extension=pdo_mysql.so
6.重启apache就ok了,在phpinfo信息里会看到,pdo_mysql的扩展支持了。
[root@localhost pdo_mysql]# /usr/local/apache2/bin/apachectl restart