23ree 发表于 2014-4-9 09:54:04

linux下php添加pdo_mysql扩展

进去到php的源码包的ext中
# cd /usr/local/src/php-5.2.17/ext/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
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql (假设你的mysql是安装在/usr/local/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"

重启apacheapachectl restart

phpinfo中有pdo_mysql了

页: [1]
查看完整版本: linux下php添加pdo_mysql扩展