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 Laravel 4 Basics Laravel and Databases Connecting Laravel to MySQL

Kristina Petravičiūtė
Kristina Petravičiūtė
11,270 Points

Connecting Laravel to Microsoft SQL

How can I connect my mssql database to Laravel? In app->config->local->database.php I change mysql to sqlsrv and add my database connect info, then in app->config->database.php I change default connection to sqlsrv and in google chrome I get message: "could not find driver". How can I fix that?

1 Answer

Andrew McCormick
Andrew McCormick
17,730 Points

you need to install the SQL Server driver for php. https://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

I'm assuming you're on a LAMP stack. If so and if you plan to continue to develop with SQL Server, I would strongly recomend moving to IIS. It will make your life so much easier. We'll easier to connect to your data source anyways.