Jump to content

Recommended Posts

I'm running:

Windows Server 2003

IIS 6.0

Microsoft SQL 2005

PHP 5.3.28

 

 

 

Everything that i have read says, "5.3 got rid of mssql and now uses sqlsrv"

so i added extension=php_sqlsrv_53_nts_vc9.dll  to my php.ini (and yes it is in the ext folder)

 

and when i run the script

 

$serverName = "localhost\phonebook"; //serverName\instanceName
// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array( "Database"=>"XXXXX", "UID"=>"XXXXX", "PWD"=>'XXXXXXXX');
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
 

 

i get

 

 


Connection could not be established.
Array ( [0] => Array ( [0] => IMSSP [sqlSTATE] => IMSSP [1] => -49

 => -49 [2] => This extension requires either the Microsoft SQL Server 2008 Native Client (SP1 or later) or the Microsoft SQL Server 2008 R2 Native Client ODBC Driver to communicate with SQL Server. Neither of those ODBC Drivers are currently installed. Access the following URL to download the Microsoft SQL Server 2008 R2 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires either the Microsoft SQL Server 2008 Native Client (SP1 or later) or the Microsoft SQL Server 2008 R2 Native Client ODBC Driver to communicate with SQL Server. Neither of those ODBC Drivers are currently installed. Access the following URL to download the Microsoft SQL Server 2008 R2 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 ) ) 

What can i do to fix this? I assume use an older .dll?

Link to comment
https://forums.phpfreaks.com/topic/289254-mssql-vs-sqlsrv-php-5328/
Share on other sites

You need to do as the error message tells you. Go to http://go.microsoft.com/fwlink/?LinkId=163712 and download then install the Microsoft SQL Server 2008 R2 Native Client package. It is required for the sqlsrv driver to function.

Edited by kicken

You need to do as the error message tells you. Go to http://go.microsoft.com/fwlink/?LinkId=163712 and download then install the Microsoft SQL Server 2008 R2 Native Client package. It is required for the sqlsrv driver to function.

Why would I do that when I am running server 2003?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.