1:进入到源码包 /usr/local/php-7.1.6/ext/pdo_mysql 执行/usr/local/php-7.1/bin/phpize
如果报如下错误:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script
yum -y install autoconf
2:
./configure --with-php-config=/usr/local/php-7.1/bin/php-config --with-pdo-mysql=/usr/local/mysql-5.7
3:make&make install
4:Installing shared extensions: /usr/local/php-7.1/lib/php/extensions/no-debug-zts-20160303/
修改php.ini加入
extension="/usr/local/php-7.1/lib/php/extensions/no-debug-zts-20160303/pdo_mysql.so"