As many of you did, I upgraded from Lucid to Precise this week and almost everything seems to work find.
everything except… SQLite, which was working well before but not anymore.
I checked everything: phpinfo(), php.ini, sqlite3.ini.
The sqlite
command works fine, but when I try to use PHP… *PLOP*, nothing works.
I get the message
Fatal error: Class 'SQLiteDatabase' not found in /var/www/test/sqlite/index.php on line 4
Line 4 being
$db = new SQLiteDatabase('test.sqlite', 0666);
Any hint?
edit
You can see my phpinfo() here: http://pastebin.com/jQ7Bz0GN
The apache log is
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Best Answer
Extensions
According to Vendor Specific Database Extensions page on the PHP site, there are two SQLite extensions:
SQLite3 extension is a newer replacement of SQLite, which soon will become obsolete:
Ubuntu 10.04 vs 12.04
Now, some practicalities. Let's have a look at default web server configuration that was installed using:
Ubuntu 10.04:
Ubuntu 12.04:
So, Ubuntu 12.04 default PHP installation (as of writing this - version 5.3.10) already does not have
sqlite
extension as built in. The output above states that onlysqlite3
extension is present, which came fromphp5-sqlite
package.Solution
Pick your evil: