Support the ongoing development of Laravel.io →
Configuration Database
Last updated 2 years ago.
0

What happens when you try to run that query in a controller?

0

Ups, sorry for not posting that information. When running this in a controller an error is thrown: "PDOException in Connector.php line 50: could not find driver"

0

Can you make a test.php file which contains <?php echo phpinfo(); ?> and check that pdo_sqlsrv exists in your environment?

Last updated 9 years ago.
0
Solution

Sorry for not responding for some time, i figured it out just a few minutes ago. On the commandline, php -i says that sqlsrv is enabled, but not with <?php echo phpinfo(); ?> this doedn't says anything about sqlsrv. In php_error_log it prints "Unable to load dynamic library D:\xampp\php\ext\php_pdo_sqlsrv.dll", but the file exists with the same permissions as the other extensions.

Really strange, so i checked the dependencies of the dll file, and i found that there is a missing dll called "msvcp110.dll" ... long story short, i installed "Visual C++ Redistributable for Visual Studio 2012" and it worked!

I really hate windows for not managing dependencies like every linux system does. (Edit: "Visual C++ Redistributable" wasn't on the requirements list of sqlsrv)

Thanks you very much for your goodwill to help me^^

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rimace rimace Joined 8 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.