参考:https://blog.csdn.net/weixin_34088598/article/details/85669874
参考:http://www.92csz.com/30/1232.html
官网:http://php.net/pdo
下载:https://pecl.php.net/package/PDO
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/ make && make install
输出:
... Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
编辑 php.ini :
找到; extension_dir = “./”这一行,去掉注释,并修改路径:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
添加:
; [pdo_mysql] extension= "pdo_mysql.so"
最后重启apache,查看:
添加:
php -m