I am running SQL Server 2019 on a Linux Ubuntu 20.04 server.
All works great remotely using SSMS. I can select, update, insert, etc
When I deploy my app on the server I get this error while trying to go to the sites url
Fatal error: 0 [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
258 [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x102
258 [Microsoft][ODBC Driver 17 for SQL Server]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. For more information see SQL Server Books Online.
in /var/www/vhosts/site.com/site.com/connections/Connection.php on line 668
On the server, I can execute sqlcmd and see my data but only when I use 127.0.0.1 for the host. If I use localhost, I get a timeout.
I changed my connection string on phpr to use 127.0.0.1 and it works just fine locally but again I get a timeout when trying on the actual site that's on the server.
Being able to run full fledged SQL Server 2019 on a linux server is so very important to me for performance. It is Express version but I changed the instance name to MSSQLSERVER so I don't have any issues with that.
It is setup to allow remote connections, and the instance name is MSSQLSERVER so it's the default for sql server.
Any ideas?
Alan