Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been trying (in vain) to connect to Microsoft SQL Server 2005/2008 using the PHP Driver for SQL Server released by Microsoft. I had to install the Native Client, the PHP Driver, edit the php.ini file. And voila, it connects but shouts an error (which is a stupid array with one of the entries which says) Native Client is required. I have installed both versions 1.0 and 1.1 (and tried connecting with separate installations as well) but in vain.

Can somebody point out where I'm going wrong? :-(

Also, how do you query a remotely hosted SQL Server from a PHP application that is running on a LAMP environment?
Posted

1 solution

I did try the native client a while ago and I didn't get it to work, so I got the mssql extension working instead.

Have you looked into the mssql[^] extension for PHP? The alternative is FreeTDS[^].

I only have experience connecting to an MSSQL DB on an IIS server with the mssql extension. The only (major) problem I had with it was that a couple of dll's were missing from the C:\Windows folder, ntwdblib.dll in particular. php_mssql.dll was also missing from C:\inetpub\php\ext folder. After I put the dll's in the right place all I had to do was update my php.ini file an it worked.

Hope that helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900