0

I'm using Ubuntu 14.04 64 bit and installed the php5 package from the repositories which brought Apache with it. Php itself works but when I try to use new SQLiteDatabase([...]), the error

Fatal error: Class 'SQLiteDatabase' not found in [...] on line [...]

is printed.

The php.ini in use is /etc/php5/apache2/php.ini (according to phpinfo() (link to the website it prints)). I noticed that in the php.ini the block

[sqlite]
; http://php.net/sqlite.assoc-case
;sqlite.assoc_case = 0

[sqlite3]
;sqlite3.extension_dir =

doesn't set an extension directory. I tried finding files called sqlite3 on my system and putting a path to their directories in there, but it didn't work (and I restarted my machine after changing the php.ini).

The package php5-sqlite3 doesn't exist for Ubuntu 14.04 but php5-sqlite does and I installed it before trying anything else. I then also installed the packages sqlite3 and sqlite, but again: I doesn't work.

6
  • can you find information about sqlite ext in your phpinfo() ? Commented Oct 17, 2015 at 22:09
  • @SergioIvanuzzo Do you mean sqlite3.extension_dir? If so: Both Local Value and Master Value are set to "no value". Otherwise: I added the website phpinfo() prints to my question: dl.dropboxusercontent.com/u/9402513/phpinfo%28%29.html Commented Oct 17, 2015 at 22:13
  • have you restarted your apache server after sqlite installing? Commented Oct 17, 2015 at 22:17
  • Yes, I did. (Some more characters so I can post this comment.) Commented Oct 17, 2015 at 22:22
  • well, I have same error after trying to install.. I will testing and answer to you, when find a solution Commented Oct 17, 2015 at 22:42

1 Answer 1

1

I have found a solution. So, according to http://stevenclark.info/wp/fatal-error-class-sqlitedatabase-not-found-in/

As of PHP 5.4 the SQLiteDatabase class was removed to make way for SQLite 3.

So, you need to use this:

$db=new SQLite3("db.sqlite");
Sign up to request clarification or add additional context in comments.

1 Comment

That would've been it? Oo It works, thank you! PDO also works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.