Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-13-2013, 01:40 PM #1
- Join Date
- Aug 2011
- Thanked 0 Times in 0 Posts
SQLite + PHP - Call to undefined function sqlite_open()
I have a SQLite database that I would like to access. I am running on a local WAMP installation.
Apache Version :2.2.17
PHP Version :5.3.5
When I attempt to do this:
$dbhandle = sqlite_open('db/ledb.sqlite', 0666, $error);
Fatal error: Call to undefined function sqlite_open() in C:\wamp\www\php_test.php on line 3
And it appears to meet the requirements. It is a Windows build and the necessary ini values are enabled. Also full admin privileges.
Any pointers on what is wrong here?
(I worked with SQLite before but not in a php environment so I might be overlooking something important?)
EDIT: The error was caused by not having properly activated the SQLite extension.
However that produces a new issue:
The database can not be accessed
Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in C:\wamp\www\php_test.php on line 3
Last edited by Jeffy; 09-13-2013 at 02:51 PM.
09-13-2013, 02:57 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,668 Times in 2,637 Posts
Either you haven't restarted your services or you don't actually meet the requirements for the module. Check the httpd error logs for startup errors.
Ensure the php_pdo_sqlite.dll is also enabled. I'm not 100% certain if that's required, but if the library requires PDO, and the PDO requires a driver, it would make sense to me that its enabled.
There is also the sqlite3 and pdo libraries worth looking into. Since the sqlite library requires the PDO, you may as well just use the PDO. My understanding is there are significant improvements between sqlite and sqlite3, but I don't know if the sqlite is directly compatible with the PDO/sqlite3 classes.PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');