php sqlite Connect Error: could not find driver

问题现象:

连接sqlite数据库,报错:Connect Error: could not find driver

产生原因:
1. 未加载pdo_sqlite
2. pdo_sqlite编译时configure未加with-pdo-sqlite参数

解决办法:

make clean

/alidata/server/php56/bin/phpize

./configure –with-php-config=/alidata/server/php56/bin/php-config –with-pdo-sqlite=/usr/bin/sqlite3

make && make install

vi /alidata/server/php56/etc/php.ini

/etc/init.d/php56-fpm restart

 



发表评论

电子邮件地址不会被公开。