Problem initializing MS SQL Database with default instance

I’m getting the dreaded:
The provided database host, username, and/or password is invalid, and a connection to the database could not be established. Please enter a valid host, username and password

Server for CRM is CentOS7, PHP 7.1, MS Sql Drivers are installed (see php check further down)

SQL Server host is Server 2016, SQL 2016, default instance (so no instance name)

if anyone see’s anything obvious that i have wrong, I’d appreciate it. My one question is, is there an issue with NO instance name being given (since we are on the default instance there is no instance name to use).

In my testing with if I try to give it the / and leave the instance name blank (so servername\ instead of just servername ) it does not like that at all and will refuse to connect.

I’ve looked in the logfiles and all that I get there is a very much un-useful :


For testing purposes I create a simple PHP file to test everything:

$serverName = "cams-dev-sql"; //serverName\instanceName
$connectionInfo = array( "Database"=>"suitecrm_dev", "UID"=>"suitecrm-dev", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));

That works with no issues. (unless I change the servername to be cams-dev-sql\ then it dies)

After ignoring everything for the weekend and then testing my test script FROM the browser I figured out the issue.

Selinux was blocking things:

setsebool -P httpd_can_network_connect on
setsebool -P httpd_can_network_connect_db on

That fixed that problem.

Problem #2 that I had after that was when I created the DB user in MS SQL I left the default DB as master (the default). The installer does NOT like that and will try to install but fail (and appear to install). Make sure to actually SET that default database and then the install ran through fine.