Over the weekend we upgraded some servers with Windows updates and now our PHP pages won't connect to our SQL Server 2008 R2 database. The pages were originally programmed with mssql_connect() and that function is now an undefined function. I have read somewhere that mssql_connect() no longer works after a certain update, so I am going to recode the few php pages that we still have using sqlsrv_connect(). My problem is, I cannot find the correct dlls to use in out setup.
PHP 5.2.9-2 on a 32-bit server
Threadsafe
php5ts.dll
IIS (which I think means VC9)
and
SQL Server 2008 R2 on a 64-bit server
I don't see the proper dll to use for sqlsrv_connect()
When using php_sqlsrv_52_ts_vc6.dll iis will reset properly and sqlsrv_connect() doesn't throw an error. However, the connection won't establish and I get the following error:
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 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 ) )
When adding php_pdo_sqlsrv_52_ts_vc6.dll to the php_sqlsrv_52_ts_vc6.dll, I get the error:
Cannot load module 'pdo_sqlsrv' because required module 'pdo' is not loaded in Unknown on line 0
If I try php_sqlsrv_53_ts_vc9.dll, I get:
the sqlsrv_connect() is an undefined function.
and
Module compiled with module API=20090626, debug=0, thread-safety=1
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match in Unknown on line 0.
Most php5ts.dll errors are related to missing or corrupt php5ts.dll files. Here are the top five most common php5ts.dll errors and how to fix them.
Our setup consists of:![Cannot Load Php5ts Dll Fixer Cannot Load Php5ts Dll Fixer](/uploads/1/2/6/8/126881934/367124377.jpg)
Threadsafe
php5ts.dll
IIS (which I think means VC9)
and
SQL Server 2008 R2 on a 64-bit server
I don't see the proper dll to use for sqlsrv_connect()
When using php_sqlsrv_52_ts_vc6.dll iis will reset properly and sqlsrv_connect() doesn't throw an error. However, the connection won't establish and I get the following error:
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 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 ) )
When adding php_pdo_sqlsrv_52_ts_vc6.dll to the php_sqlsrv_52_ts_vc6.dll, I get the error:
Cannot load module 'pdo_sqlsrv' because required module 'pdo' is not loaded in Unknown on line 0
Php5ts.dll
If I try php_sqlsrv_53_ts_vc9.dll, I get:
the sqlsrv_connect() is an undefined function.
and
Php5ts.dll Error
PHP Startup: sqlsrv: Unable to initialize moduleModule compiled with module API=20090626, debug=0, thread-safety=1
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match in Unknown on line 0.