I have a big problem connecting my php page which is running on the same PC as my SQL Server with the SQL server and execute things...
Maybe this following warning will help you:
Warning: odbc_connect(): SQL error: [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. , SQL state 08001 in SQLConnect in MY_CONFIG_FILE on line 9
I wonder what causes this problem as the webserver with the php page is running on the same machine as my SQL server does.
I´m using this code:
odbc_connect("Driver={SQL Server Native Client 11.0};Server='MY_IP';Database='MY_DATABASE';", 'MY_SQL_USER', 'THE_PW_OF_MY_SQL_USER');
What I have tried so far:
- Adding the IP to the host file of Windows
- Switching the complete firewall off
- adding a User-DSN ODBC Connection called SQLEXPRESS with a working connectivity test
- Connecting from my home PC with SQL Management Studio to the SQL Server. It worked with the same login data and IP which I´ve added in the SQL Config File.
- Enabling TCP/IP and Named Pipes in the SQL Management Studio on port 1433
- Restarting everything several times (Professional Solution, I know ;))
- enabling TCP/IP and Named Pipes in the cliconfg.exe
I hope there are some gurus here which can help me :)
Thx a lot in advance ;)