PDO_SQLITE driver not present.. what to do?
did you try sudo apt-get install php5-sqlite
?
Current version:sudo apt install php7.4-sqlite
pdo sqlite could not find driver... php file not processing
You need
[PDO_SQLITE]
extension=pdo_sqlite.so
to be enabled, for sqlite:.subscribers.db
or, for windows:
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
And ofcourse this extension in your ext
directory How to enable the PDO driver for sqlite3 in php?
I think that the PDO driver for sqlite3 is called 'sqlite', so you already have it installed. The sqlite2 driver is older.
PDO_SQLITE is a driver thatFrom http://php.net/manual/en/ref.pdo-sqlite.php
implements the PHP Data Objects (PDO)
interface to enable access to SQLite 3
databases.In PHP 5.1, the SQLite extension also
provides a driver for SQLite 2
databases; while it is not technically
a part of the PDO_SQLITE driver, it
behaves similarly, so it is documented
alongside it. The SQLite 2 driver for
PDO is provided primarily to make it
easier to import legacy SQLite 2
database files into an application
that uses the faster, more efficient
SQLite 3 driver. As a result, the
SQLite 2 driver is not as feature-rich
as the SQLite 3 driver.
Xampp won't connect with Sqlite: could not find driver
I found the solution. I didn't get to knew where the problem exactly was.
When I visited https://www.php.net/manual/en/sqlite3.requirements.php I saw that you need libsqlite3.dll
. I went on more research. I had to copy libsqlite3.dll
from the /php
folder to the /apache/bin
folder. That didn't solve the issues in the terminal, but it did connect to the Sqlite database.
Unable to load pdo_sqlite.so extension
You've got (at least part of) two different versions of php installed, and they're conflicting. You'll probably want to clean out the version you're not using in order to prevent further issues. It might be easiest to just wipe both and then reinstall the one you want. Also make sure that your php.ini has its extension_dir
setting pointing to the correct directory for the version you're keeping.
The internal PHP API is versioned according to date, so when backwards-incompatible changes are made and a new version is required, you'll get a new subdirectory name. If the changes are backward-compatible, and no new API version is required, then you can make minor updates to your PHP version without having to recompile your extensions.
I believe 20131226 is for PHP version 5.6 and 20160303 is for PHP version 7.
Unable to load pdo_sqlite
On restarting my computer (and thus the IDE I am using, IntelliJ), I received a different error when running the config.php
file - that I needed to install php-cgi
.
I did so and no longer received the exception when running config.php
. I suppose I already solved that problem and it just required an IDE restart to apply it.
The second issue, that still remained, was the warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20170718/pdo_sqlite (/usr/lib/php/20170718/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_sqlite.so (/usr/lib/php/20170718/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver)) in Unknown on line 0
PHP Warning: Module 'sqlite3' already loaded in Unknown on line 0
And I resolved this using the answer here:In trying to find a solution earlier, I had uncommented a few lines in theIt means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension.
php.ini
file. Simple commenting them back fixed the issue!
Related Topics
How to Disable the Back Browser Button After User Press Logout and Destroy Session
Use MySQL_Fetch_Array() with Foreach() Instead of While()
How to Remove Email Addresses and Links from a String in PHP
PHP Readfile() Causing Corrupt File Downloads
Insert Backbone.Js Model into MySQL Database
PHP Explode Array Then Loop Through Values and Output to Variable
Built in Support for Sets in PHP
How to Put the Results of a MySQLi Prepared Statement into an Associative Array
Convert Windows Timestamp to Date Using PHP on a Linux Box
Set Maximum Execution Time for Exec() Specifically
MySQL Int(11) Number Out of Range
Ffmpeg Mamp "Dyld: Library Not Loaded" Error
Setting Max_Input_Vars PHP.Ini Directive Using Ini_Set
PHP Sum Variable in While Loop
How to Get Last Insert Id in Eloquent Orm Laravel
Docx File Type in PHP Finfo_File Is Application/Zip
Why Is MySQLi_Insert_Id() Always Returning 0
Create an Assoc Array with Equal Keys and Values from a Regular Array