1

I have XAMPP installed but SQLSRV won't show up in PHP info from localhost:81 (81 is the port through which my localhost is accessible).

I downloaded the official SQLSRV drivers from Microsoft and added them to my php.ini like this:

enter image description here

I also tried the x86 drivers instead, but neither work!

The driver files are located as they should be in C:\xampp\php\ext

Is it just that SQLSRV doesn't work with PHP 7.1.1 yet? Where can I find the latest drivers? I downloaded and used SQLSRV40 and SQLSRV30, neither work at all.

Note: SQL Server Native Client 11 is installed

6
  • 2
    The fact that you're even trying random architectures suggest you aren't really aware of your system specs and you've possibly haven't installed the support libraries. In any case, I suggest you configure PHP to display errors so at least you have a chance of knowing what's wrong. It also helps to run PHP from the console, where startup errors show up instantly. Commented Apr 25, 2017 at 14:42
  • Makes sense. As far as I am aware I have satisfied all the requirements as I can create and connect to a database from the same machine using SQL Server 2016. Stuff like the native client is installed so this should be working... I don't want to use SQL Server 2016 as I want to sync my accessible SQL databases between machines using Dropbox and trying that on SQLSrv 2016 proved to be a total nightmare. With XAMPP I can boot apache and SQL, both go green and PHP My Admin works just fine... I just won't display SQLSRV even though the extension should be running it Commented Apr 25, 2017 at 14:45
  • 1
    But, for instance, you already know that SQLSRV/3.0 will not run on PHP/7.1, there's no point in trying. Commented Apr 25, 2017 at 14:47
  • Again makes sense. But I also tried 4.0 which was the correct distribution (I think?) as it contains files like "php_sqlsrv_7_ts_x64.dll". Where it says "sqlsrv_7" I assume that this means the file it produced for use with PHP 7. It is a huge assumption but that's why I'm coming here, to try and find out the real answer! Commented Apr 25, 2017 at 14:55
  • 1
    You'll get some light when you manage to see startup errors. Commented Apr 25, 2017 at 15:03

2 Answers 2

3

I had the same problem and wasted a lot of time trying to fix it. What solved it for me was quite simple: - I uninstalled XAMPP and reinstalled the 7.0.15 / PHP 7.0.15 version
- I added the x86 drivers to C:\xampp\php\ext and also to php.ini

At the moment it seems that SQLSRV isn't working with PHP 7.1.1 yet. I hope this helps you out.

1

Remove this line from php.ini:

extension=php_sqlsrv_7_ts_x64.dll

and try again

It should show up in Registered PHP Streams when you view PHP info

1
  • i try to remove that, but the errors still same.. i dont see the driver in phpinfo(). why ? anybody help me? Commented Oct 27, 2017 at 4:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.