php PDO_SQLITE 驱动程序不存在..怎么办?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8822209/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PDO_SQLITE driver not present.. what to do?
提问by Felipe Almeida
I see everywhere (including on the official docs) that the PDO_SQLITEdriver is/should be included by default in PHP.
我在任何地方(包括官方文档)都看到PDO_SQLITE驱动程序是/应该默认包含在 PHP 中。
However, when I look at my extension_directory
, I see only these files:
但是,当我查看 my 时extension_directory
,我只看到以下文件:
gd.so mcrypt.so mysqli.so mysql.so pdo_mysql.so pdo.so
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...
结果,我尝试安装的框架(Symfony)告诉我需要安装 PDO_SQLITE 或 SQLite3 .so 扩展...
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??
任何人都可以帮忙吗?我可以尝试在网络上的某个地方找到所需的 .so 文件,将其放在我的 extensions_directory 中,然后将其包含在php.ini 中吗?
BTW:I'm running php 5.3.6 downloaded via apt-get on ubuntu.
顺便说一句:我正在 ubuntu 上运行通过 apt-get 下载的 php 5.3.6。
回答by jere
did you try sudo apt-get install php5-sqlite
?
你试过sudo apt-get install php5-sqlite
吗?
回答by Santo Boldi?ar
For PHP 7.0 and greater:
对于 PHP 7.0 及更高版本:
sudo apt-get install php-sqlite3
回答by Mohammed Saqib Rajput
For Windows users:
对于 Windows 用户:
removed comment (;
) from php.ini
;
从 php.ini 中删除注释 ( )
extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
回答by sh6210
In my case i was using php 7.2 in Ubuntu. I had to run following command,
就我而言,我在 Ubuntu 中使用 php 7.2。我必须运行以下命令,
sudo apt install php7.2-sqlite
回答by rui
For Windows 10 - 64bits, version PHP 7.2 It's necessary remove only ( ; ) Before ;extension=pdo_sqlite ;extension=sqlite3
对于 Windows 10 - 64 位,版本 PHP 7.2 只需要删除 ( ; ) 之前 ;extension=pdo_sqlite ;extension=sqlite3
After extension=pdo_sqlite extension=sqlite3
后扩展=pdo_sqlite 扩展=sqlite3
Restart the server and already.
重新启动服务器。