Could not open a connection to SQL Server
Posted: 04 Jul 2017, 14:31
I am trying to install Mantis 2.5.1 with PHP 7.0.15 and MS SQL Server 2012. The database is already created and user has db owner permission. Pre-installation check has no errors, but when I try to install database, I get an error as:
"SQLState: 08001 Error Code: 67 Message: [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [67]. ....A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. ..."
I have checked the following already:
$g_hostname = 'Driver={SQL Server};SERVER=server;DATABASE=dbname;UID=username;PWD=password;';
$g_db_username = 'username';
$g_db_password = 'password';
$g_db_type = 'odbc_mssql';
What could I be missing? Pls help.
"SQLState: 08001 Error Code: 67 Message: [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [67]. ....A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. ..."
I have checked the following already:
- Named pipes is already enabled on sql server.
- I have copied php_sqlsrv_7_nts_x64.dll and php_pdo_sqlsrv_7_nts_x64.dll to php extension directory, and enabled them as extensions in PHP manager in IIS 7.
- Connection to sql server is possible with same credentials (tested using conn.udl)
$g_hostname = 'Driver={SQL Server};SERVER=server;DATABASE=dbname;UID=username;PWD=password;';
$g_db_username = 'username';
$g_db_password = 'password';
$g_db_type = 'odbc_mssql';
What could I be missing? Pls help.