So I have Apache web server installed and running. It is serving up web pages and php files fine but I can’t seem to hook into SQLite3 from php.
This is my index.php file
$db = new SQLite3('test.db');
and here’s the output:
Fatal error: Uncaught Error: Class "SQLite3" not found in C:Apache24htdocsindex.php:2 Stack trace: #0 {main} thrown in C:Apache24htdocsindex.php on line 2
I have tried changing the relevant values in my php.ini file:
sqlite3.extension_dir =./ext/php_sqlite3.dll
...
extension_dir = "ext"
...
extension=sqlite3
...
After making those changes I restarted my web server with
./httpd
but I still get the same error about the SQLite3 class not being found.
Also, I noticed that the configuration file path has no value but the loaded configuration file points to the right location:
phpinfo
Thanks all, and happy coding!
I tried changing some values in php.ini hoping the web server would pick up the sqlite3 extension.
I was expecting the web server to be able to run the code $db = new SQLite3('test.db');
but the actual result was Fatal error: Uncaught Error: Class "SQLite3" not found in C:Apache24htdocsindex.php:2 Stack trace: #0 {main} thrown in C:Apache24htdocsindex.php on line 2
.
Kelan Riley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.