Frage

I have a laptop running with windows 7 Professional, MSSQL 2008 R2 and IIS 7.5. The system has all my applications in c# and php running successfully. Now I wanted to transfer all my files and apps on a 2nd laptop with windows 7 Ultimate. But for some reason I just cannot get a successful connection to my db even though phpinfo() shows sqlsrv installed and I am using the exact same code just changing the connection string of the DB.

I have MSSQL management Studio v 10.50.2500
IIS v 7.5.7600.16385
PHP v 5.5.3
SQLSRV Driver for php 5.5 (its not an official MS release , but its quite popular and works on my previous laptop )

I am getting an error like :


    Array (
    [0] => Array (
                 [0] => IMSSP [SQLSTATE] => IMSSP 
                      [1] => -49 [code] => -49 
                      [2] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 
                      [message] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 
                       ) 
          [1] => Array (
                       [0] => IM002 [SQLSTATE] => IM002 
                       [1] => 0 [code] => 0 
                       [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
                       [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
                       )
          )

my PHP code is as follows (which i know for a fact it works on the first laptop) :


    `$serverName = "DELL-PC"; //serverName\instanceName`
    ``
    `$connectionInfo = array( "Database"=>"amlTest");`
    `$conn = sqlsrv_connect( $serverName, $connectionInfo);`

I just cannot figure out what is the problem or where am I missing out? I really need this working!! and have spent far too much time re-installing all my softwares and trying out all php versions.
I hope its not because of the difference in windows version

Also, Sorry if I have made any mistake formatting my question, as this is my first post.

War es hilfreich?

Lösung

Have you installed the feature pack?

http://microsoft.com/en-us/download/details.aspx?id=29065

A hint from the error tells us that you need the 2012 version of the MS SQL Server for this to work. Also make sure your Server permissions are set correctly.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top