centos 6.5 安装 pdo_mysql

时间:2021-07-05 19:23:33

centos 6.5 安装 pdo_mysql

wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

tar -zxvf 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 --with-pdo-mysql=/usr/local/mysql

ln -s /usr/local/mysql/include/* /usr/local/include/

make && make install

mv /usr/local/php/lib/php/extensions/no-debug-zts-20100525/pdo_mysql.so  /usr/local/php/lib/php/extensions/

修改 php.ini

extension_dir = “/usr/local/php/lib/php/extensions/”

extension=pdo_mysql.so

利用phpinfo()查看系统加载的配置文件路径,有的可能是/etc/php.ini