PDO_SQLITE driver not present.. what to do?

╄→尐↘猪︶ㄣ 提交于 2019-11-29 10:37:52

问题


I see everywhere (including on the official docs) that the PDO_SQLITE driver is/should be included by default in PHP.

However, when I look at my extension_directory, I see only these files:

gd.so mcrypt.so mysqli.so mysql.so pdo_mysql.so pdo.so

And, as a result, a framework I'm trying to install (Symfony) tells me I need to install either the PDO_SQLITE or the SQLite3 .so extensions...

Can anyone help? Can I just try and find the needed .so file somewhere on the web, place it in my extensions_directory and then include it in php.ini??

BTW: I'm running php 5.3.6 downloaded via apt-get on ubuntu.


回答1:


did you try sudo apt-get install php5-sqlite?




回答2:


For PHP 7.0 and greater:

sudo apt-get install php-sqlite3



回答3:


For Windows users:

removed comment (;) from php.ini

extension=php_pdo_sqlite.dll

extension=php_sqlite3.dll



回答4:


In my case i was using php 7.2 in Ubuntu. I had to run following command,

sudo apt install php7.2-sqlite



回答5:


For Windows 10 - 64bits, version PHP 7.2 It's necessary remove only ( ; ) Before ;extension=pdo_sqlite ;extension=sqlite3

After extension=pdo_sqlite extension=sqlite3

Restart the server and already.



来源:https://stackoverflow.com/questions/8822209/pdo-sqlite-driver-not-present-what-to-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!