Sunteți pe pagina 1din 3

PHP 5.3 + IIS6.0 + Windows Server 2003 R2 SP2 not recognizing native ...

http://forums.iis.net/p/1188255/2017673.aspx#2017673

Home > Forums > Partner and Community Forums > PHP Community > PHP 5.3 + IIS6.0 + Windows Server 2003 R2 SP2 not recognizing native client Previous Next

Last post 03-29-2012 4:33 AM by sl_fede. 1 replies.

Page 1 of 1 (2 items) Sort Posts: Oldest to newest Shortcuts Search | Active Posts | Unanswered Posts | View all users 03-23-2012, 12:11 PM sl_fede PHP 5.3 + IIS6.0 + Windows Server 2003 R2 SP2 not recognizing native client Reply Contact Joined on 07-29-2011, 4:29 AM Posts 4

Hi Guys, We have this setup SERVER A Windows Server 2003 R2 SP2 x86 IIS 6.0 PHP 5.3.10 VC9 TS Microsoft Sql Drivers for PHP (sqlsrv) 2.0 Native Client 2008 R2 x86 SERVER B Windows Server 2008 R2 x64 Microsoft SQL Server 2008 R2 x64 When using this script to connect from server A <?php $serverName='DBSERVER'; $connParams=array('UID'=>'UID','PWD'=>'PASSWORD','Database'=>'DATABASENAM $conn=sqlsrv_connect($serverName,$connParams); if(!$conn){ $errors=sqlsrv_errors(); die(var_dump($errors)); } sqlsrv_connect($conn);

1 of 3

5/6/2012 12:13 PM

PHP 5.3 + IIS6.0 + Windows Server 2003 R2 SP2 not recognizing native ...

http://forums.iis.net/p/1188255/2017673.aspx#2017673

die('connected'); ?> I'm getting this error >array(2){[0]=>array(6){[0]=>string(5)"IMSSP"["SQLSTATE"]=> >string(5)"IMSSP"[1]=>int(49)["code"]=>int(49)[2]=>string(390) >"ThisextensionrequireseithertheMicrosoftSQLServer2008Native >Client(SP1orlater)ortheMicrosoftSQLServer2008R2Native >ClientODBCDrivertocommunicatewithSQLServer.Neitherofthose >ODBCDriversarecurrentlyinstalled.AccessthefollowingURLto >downloadtheMicrosoftSQLServer2008R2NativeClientODBCdriver >forx86:http://go.microsoft.com/fwlink/?LinkId=163712"["message"]=> >string(390)"ThisextensionrequireseithertheMicrosoftSQLServer >2008NativeClient(SP1orlater)ortheMicrosoftSQLServer2008R2 >NativeClientODBCDrivertocommunicatewithSQLServer.Neitherof >thoseODBCDriversarecurrentlyinstalled.AccessthefollowingURL >todownloadtheMicrosoftSQLServer2008R2NativeClientODBCdriver >forx86:http://go.microsoft.com/fwlink/?LinkId=163712"}[1]=> >array(6){[0]=>string(5)"IM002"["SQLSTATE"]=>string(5)"IM002" >[1]=>int(0)["code"]=>int(0)[2]=>string(91)"[Microsoft][ODBC >DriverManager]Datasourcenamenotfoundandnodefaultdriver >specified"["message"]=>string(91)"[Microsoft][ODBCDriverManager] >Datasourcenamenotfoundandnodefaultdriverspecified"}} I've been googling around for the last couple of days and couldn't find a solution. I've tried: - Changing the identity in the Application Pool - IISreset - Adding other user with less restricted permissions to PHP folder and the native client dlls - Reinstalling PHP - Reinstalling Native Client Still getting the same error. UPDATE I installed SQLCMD tools and it connects correctly to the server. SQLCMD -S tcp:SERVER,1433 -Q "select getdate()" I get a reply with todays date so it looks to be connecting correctly. The DLL versions are SQLNCLI10.DLL 2009.100.1600.1 SQLSRV32.DLL 2000.85.1117.0 (I Updated this one with the DLL from another server but still didn't help) It is now Version 6.1.7600.16385 If I use odbc_connect it works, but why doesn't it work with sqlsrv_connect? Our developer tells me that it's better to use sqlsrv_connect because it works better with zend and bulk updates. We can't upgrade server a because we have a number of legacy code running 32 bit services which wont run in WS2008 64bit If we try this same script from the test server or localhost it works fine. Are we missing something? We've been thourgh sqlsrv requirements and it's all there but can't reach the native client. If I create an odbc connection n control panel using Native Client there

2 of 3

5/6/2012 12:13 PM

PHP 5.3 + IIS6.0 + Windows Server 2003 R2 SP2 not recognizing native ...

http://forums.iis.net/p/1188255/2017673.aspx#2017673

is no problem. Also running static php pages work fine, so the problem is between sqlsrv and native client. Any help would be great! Federico
Tags: PHP iis 6 SQL Error PHP 5 IIS6 installation sqlsrv sqlsrv_connect native client 03-29-2012, 4:33 AM sl_fede Re: PHP 5.3 + IIS6.0 + Windows Server 2003 R2 SP2 not recognizing native client Reply Contact Joined on 07-29-2011, 4:29 AM Posts 4 In reply to

As it turned out, it was a permission issue. I'm using the application pool as Network Service. This user was getting access denied to the registry where tthe path to the Native Client is stored. I downloaded Process Monitor and followed the instructions on this post http://www.iislogs.com/articles/processmonitorw3wp/ Then I saw the process w3wp.exe was getting access denied on this registry key HKLM\Software\ODBC\ODBCINST.INI\SQL Native Client 10.0 I opened RegEdit and went to that key. I did right click - > Permissions and added Network Service to the list and gave it Read permissions. Recycled the app pool and it is now working! Cheers, Fede Tags: Permissions Registry process
Page 1 of 1 (2 items)

3 of 3

5/6/2012 12:13 PM

S-ar putea să vă placă și