Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.

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

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

?>

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.