XAMPP (PHP) mit Microsoft SQL Server 2008 R2 verbinden

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

XAMPP (PHP) mit Microsoft SQL Server 2008 R2 verbinden

Postby amnael » 09. March 2013 20:22

Ich möchte gerne mit PHP eine verbindung zu einem Microsoft SQL Server verbinden und habe follgende Extensions in der php.ini eingebunden:

Code: Select all
...
extension=php_sqlsrv_54_ts.dll
extension=php_pdo_sqlsrv_54_ts.dll
...


Ich benutze follgendes Script, um die Verbindung zu testen:
Code: Select all
$serverName = "(local)\MSSQLSERVER"; //serverName\instanceName
$connectionInfo = array( "Database"=>"Account",);
$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));
}
?>


Wenn ich das Script aufrufekommt diese Ausgabe:
Code: Select all
Connection could not be established.
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] Der Datenquellenname wurde nicht gefunden, und es wurde kein Standardtreiber angegeben [message] => [Microsoft][ODBC Driver Manager] Der Datenquellenname wurde nicht gefunden, und es wurde kein Standardtreiber angegeben ) )


Was muss ich machen um eine Verbindung aufzubauen?
amnael
 
Posts: 2
Joined: 09. March 2013 20:14
Operating System: Windows 7

Re: XAMPP (PHP) mit Microsoft SQL Server 2008 R2 verbinden

Postby Altrea » 09. March 2013 20:31

amnael wrote:Was muss ich machen um eine Verbindung aufzubauen?

steht doch da

[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
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP (PHP) mit Microsoft SQL Server 2008 R2 verbinden

Postby amnael » 09. March 2013 21:02

Habe den Native Client 2012 heruntergeladen und istalliert, dann hat es funktioniert.
amnael
 
Posts: 2
Joined: 09. March 2013 20:14
Operating System: Windows 7


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 26 guests