Skip to content
Advertisement

Can Microsoft’s SQLSRV driver for PHP run on Apache?

Scenario:

  • I have a PHP website running on Apache server
  • I have an ERP system (MS SQL) that runs on a different server
  • I need to connect from my website to that MS SQL server

I need to work with Microsoft SQL Server in my PHP application. I’ve managed to get their SQLSRV driver for PHP running on my localhost (WAMP, Apache + PHP 7.2).

I will need to deploy the app to a live website in the future that also runs on Apache server. Will this work? I can see Windows / Windows Server operating systems on their requirements page, but I am not sure whether they mean on the client side (the app that loads the driver) or the server side (where database is stored). On WAMP it works, but I am not sure whether it is because the WAMP itself is running on Windows (even though the server runs on Apache) or not.

Advertisement

Answer

Firstly, you’re asking the wrong question. Apache is the web server which you’re already using, so you know that the answer to “can it run with Apache?” is “yes”.

The relevant compatibility is with the operating system – you’re running it on Windows, and you need to know if it will run on a different OS, probably some flavour of Linux.

Secondly, the documentation you’ve found looks to be very out of date. Microsoft has up to date documentation on their own site including a much larger list of supported operating systems. As well as Windows, it lists the versions of several Linux distributions that are officially supported, and several versions of macOS.

It’s impossible to say for certain, or give any details of what packages you’ll need to install, because you don’t actually tell us what system your production server is; but the answer is almost certainly yes, a compatible version of the sqlsrv driver will be available.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement