Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

my local web server on one machine running Ubuntu 11.04 works fine using php5 to access sqlite3 - however on a new machine running Ubuntu 11.10 the same code, same structure, does not work at all - even though phpinfo() indicates all modules are enabled.

Any idea's on how to solve this issue?

phpinfo() on my Ubuntu 11.04 machine indicates PHP Version 5.3.5-1ubuntu7.3 but the newer Ubuntu 11.10 only supports PHP Version 5.3.6-13ubuntu3.2 ?

Why has it gone back to Ubuntu3.2?

The php code seems to be able open the database file ok, but fails when accessing a Sqlite query in the code below?

$result = $db->query('SELECT * FROM sysconfig');
$data = $result->fetchArray(SQLITE_NUM);

The variable $data returns null (however it returns data on Ubuntu 11.04 - ok)


share|improve this question
It has not actually „gone back”. The version number is higher (5.3.6 vs. 5.3.5). The part you are referring to is a minor Ubuntu-specific version (13ubuntu3 subversion 2). See: – lgarzo Nov 21 '11 at 13:18

You're executing the query without checking whether its return value is sane. You may get clues as to why this is failing by looking at the return value from this:

$result = $db->query('SELECT * FROM sysconfig');

Remember that $result will be FALSE if the query didn't execute successfully. So after that line you can do:

if (!$result) {
share|improve this answer

Ensure you've installed the php5-sqlite package.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.