CentOS安装pdo_mysql扩展

# 下载文件包
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

# 解压
tar xzvf 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
make
make install

# 切换目录,查看pdo_mysql.so是否存在
cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

# 编辑php.ini
vi /usr/local/php/etc/php.ini

# 添加pdo_mysql扩展
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so

# 重启apache
/usr/local/apache2/bin/apachectl restart

你可能感兴趣的:(WEB)