그래, IIS 6.0에서 PHP 5.2.17로 SQL Server 2005를 설정하는 데 문제가 있습니다.SQL Server PHP IIS
나는 모든 드라이버와 네이티브 클라이언트를 지시대로 설치했으며 phpinfo() 출력에는 sqlsrv와 이에 대한 적절한 설정이 들어 있습니다.
하지만,이 명령을 사용하여 연결을 시도 :
sqlsrv_connect("address,port", array("UID"=>"un", "PWD"=>"pw", "Database"=>"db"));
나는 다음과 같은 오류 출력을 얻을 :
Array
(
[0] => Array
(
[0] => IMSSP
[SQLSTATE] => IMSSP
[1] => -49
[code] => -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 O
DBC Driver to communicate with SQL Server. Neither of those ODBC Drivers are cu
rrently installed. Access the following URL to download the Microsoft SQL Server
2008 R2 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?Link
Id=163712
[message] => This extension requires either the Microsoft SQL Server
2008 Native Client (SP1 or later) or the Microsoft SQL Server 2008 R2 Native Cl
ient 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 a
nd no default driver specified
[message] => [Microsoft][ODBC Driver Manager] Data source name not f
ound and no default driver specified
)
)
sqlncli.dll는 창/system32 폴더 및 php_sqlsrv_52_ts_vc6에서입니다. dll은 php 확장 폴더에 있고 php.ini에서로드하도록 설정됩니다.
phpinfo에서 확장 프로그램이로드되고 ODBC 드라이버 관리자 오류가 발생하는 이유가 확실하지 않은 경우 확장 프로그램이 필요한 이유가 확실하지 않습니다.
어떤 통찰력이라도 대단히 감사하겠습니다.
========================================
업데이트/편집 : 나는 연결을 사용하여 다음 시도하고 잘 작동 :
odbc_connect("Driver={SQL Native Client};Server=servername;Database=db", "un", "pw");
내가 제대로 작동 sqlsrv_connect을 방지 할 수 php.ini 파일에서 누락 될 수있는 설정이 있나요?
직접 링크가있는 [MDSN sqlsrv 시스템 요구 사항] (http://msdn.microsoft.com/en-us/library/cc296170.aspx) 페이지 – icc97