Jump to content


Photo

mssql vs sqlsrv PHP 5.3.28

php 5.3.28 mssql sql sqlsrv php

  • Please log in to reply
2 replies to this topic

#1 whiteboikyle

whiteboikyle

    Advanced Member

  • Members
  • PipPipPip
  • 290 posts

Posted 23 June 2014 - 07:23 AM

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 [code=auto:0] => -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..../?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..../?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code=auto:0] => 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?



#2 kicken

kicken

    Wiser? Not exactly.

  • Gurus
  • 2,731 posts
  • LocationBonita, FL

Posted 23 June 2014 - 10:34 AM

You need to do as the error message tells you. Go to http://go.microsoft..../?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, 23 June 2014 - 10:35 AM.

Recycle your old CD's, don't trash them!
Did I help you out?  Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7

#3 whiteboikyle

whiteboikyle

    Advanced Member

  • Members
  • PipPipPip
  • 290 posts

Posted 23 June 2014 - 10:36 PM

You need to do as the error message tells you. Go to http://go.microsoft..../?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?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com