2

I am trying to install Drivers for PHP to be able to talk to my SQL Server. I am running PHP 5.5.15 on XAMPP, and SQL Server 2014. I downloaded a driver package from here: http://www.microsoft.com/en-us/download/details.aspx?id=20098 (SQLSRV30.EXE). I have copied them to my php extension folder (C:\xampp\php\ext), and, in php.ini, specified:

extension=php_pdo_sqlsrv_54_nts.dll to load the php_pdo_sqlsrv_54_nts.dll driver located now at C:\xampp\php\ext, however, when I now stop and restart the server, I get error messages as in this image (first the top box, then the bottom one).

The server runs fine if I don't try to load the driver, and also, I am not sure why it is complaining about not finding the module in the second box, as it is certainly in the place it is looking for it. I am not sure if this could have to do with the fact that this driver is for PHP 5.4, and I am running 5.5.15. Unfortunately, I was only able to find drivers for PHP 5.3 and 5.4, and thought I'd give it a shot with the 5.4 drivers.

1 Answer 1

1

Are you using PHP Non Thread Safe or Thread Safe. You can check this with your phpinfo.php file. If you are using PHP Non Thread Safe then dll name contains nts should be used and for Thread Safe use dll name contains ts. Refer below image for more details. You should also need SQL native client to be installed to access MSSQL server.

enter image description here

5
  • Hey Renju, thanks for your answer. So, I have checked phpinfo, and it is running a thread-safe version, so I have changed the module I use to be the thread-safe one. Now I use php_pdo_sqlsrv_54_ts.dll. It doesn't complain about not finding php5.dll anymore, as I assume it is now, correctly, finding php5ts.dll. However, it now complains that the module was compiled with API 20100525 and PHP was compiled with API 20121212. I am not sure why I don't have any files containing vc9 or vc6, I only have the files marked in this screen: i.imgur.com/urEmuMv.png. Commented Sep 26, 2014 at 7:05
  • Using php_pdo_sqlsrv_53_ts.dll gives the same error, just with a different API version number Commented Sep 26, 2014 at 7:06
  • I am guessing this could be due to the fact that this is php 5.5.15, and the drivers are for 5.4/5.3, or what would you say? Commented Sep 26, 2014 at 8:14
  • @user2606742 : This error is because of API version conflict. you are trying with wrong PHP version and .dll files. You need to do compiling in order to get 5.5 dll's. you will get files from here. You will get a walk through from here. Also read this post Commented Sep 26, 2014 at 8:31
  • Hey thanks, yeah, it seems Microsoft hasn't released drivers for PHP 5.5 and 5.6, and many people are complaining about it. Anyway, I got the drivers from robsphp.blogspot.co.uk/2012/06/…, I'm sure yours would have worked as well. Anyway, I'll mark your answer as correct, as you brought my attention to the thread-safety issue, and also provided a link for working drivers for 5.5 and 5.6. Thanks for your help! Commented Sep 26, 2014 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .