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 Connecting with PDO

Error message after initial PHP code

After typing the initial PHP code, I get a 'could not find driver' error message. I typed the code exactly how it appears. Any info would be appreciated. Thanks.

Oğulcan Girginc
Oğulcan Girginc
24,848 Points

Can you share the code, please?

sorry, <?php ini_set('display_errors', 'On');

$db = new PDO('sqlite:./database.db');


1 Answer

Andrew Dunn
Andrew Dunn
14,718 Points

Are you using Workspaces? That works for me in that environment - perhaps Treehouse already fixed the error if you are using this platform.

If you're using your own host, it's likely that an Sqlite driver isn't installed at all.