1

I am trying to connect to sqlite 3 .db.

$db = new SQLite3('path/to/db.db');

This gives me Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file. Does it have something to do with php.ini? I read that i need to change permissions or something but didn't manage to do that. Also I am developing a web with Wordpress. Maybe I need to install sqlite or something, but how? Thanks.

3
  • are you using an extension to support sqlite? Wordpress doesn't support anything except mysql - there's a sqlite extension, but it's a bit hacky Commented Aug 27, 2016 at 11:21
  • WordPress, of course, uses MySQL, not SQLite. You may wish to edit your question to explain better what you're trying to do. Commented Aug 27, 2016 at 11:21
  • I do have .db file which is SQLite and I want to open it with php and edit and so on. I am not using extensions Commented Aug 27, 2016 at 11:27

1 Answer 1

1

Wordpress only supports MySQL.
There's an extension that supposedly supports Sqlite, but I've not personally used it, nor would I - https://wordpress.org/plugins/sqlite-integration/

Sometimes, just because you can, doesn't mean you should.

Sign up to request clarification or add additional context in comments.

3 Comments

Just use mysql?! What's wrong with using the (only) supported database if you're wanting to use wordpress?
I am not a lot experienced with all this php sqlite or mysql. I just want to edit .db file which is SQLite format 3. Can I do it with mysql?
Wordpress only supports mysql. It's easy to learn, there's loads of tutorials. Trying to hack it to use sqlite is a recipe for disaster imo.

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.