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 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,729 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.