Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP & Databases with PDO Getting Started With PDO Introductions

How can i run sqlite locally ? with xampp or wampp ?

I using xampp and Netbeans IDE as my text editor. I would really like to know how i can use sqlite with xamp. Currently if i try the console with phpmyadmin (localhost) i get a syntax error. Any help is appreciated !

3 Answers

I want to say that you don't need anything installed for SQLite - atleast not inside xampp..

SQLite is basically a database in a file. Php does the heavy lifting of managing that database and it's php where you need to have sqlite installed. This should come packaged with xampp by default (if it's not being rubbish).

You can check if it's installed by running this at the very top of a script:



Scroll down the list or (cmd + f or ctrl + f) for sqlite. Generally speaking, if a plugin or software has made it to the phpinfo() list, it's installed okay. Source

If you want an equivalent gui like PHPMyAdmin, I've used this in the past. There are lot's available, some paid some free, just search 'sqlite gui' or similar.

Hope this helps!

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 90,705 Points

Hi Tom,

So based on this would you be able to tell me how I can get into an sqlite terminal beyond the Workspaces environment? Or am I not supposed to?

Hey Jonathan Grieve ,

Do you have a local environment set up? If you've got a copy of the code locally (on your computer, not on workspaces), you should be able to access it in the exact same way. You just need to 'cd' to the write directory and on you go!

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 90,705 Points

Hi there Tom,

Yes I have localhost on Xampp and I've just worked out how to access sqlite3 with the Shell it provides. Hurrah.

Just working out now how to get a copy of the database file. All i've got is an empty file filled database.db. I'm getting there, thanks. :)

Tomasz Budny
Tomasz Budny
14,588 Points

As far as I know XAMPP comes only with MySQL. Also phpMyAdmin supports only MySQL. So if you want to use SQLite you should install it separately and use a different database administration client or just its command line.

Thanks a lot guys ! I will try to make this work.