I am attempting to get a site using PHP to connect to my Microsoft SQL Server, below is everything I can think of:
Server: 2012
SQL Server: 2012
PHP: 7.2.6
Code:
<?php
$serverName = "ServerName";
$connectionInfo = array( "Database"=>"DBname", "UID"=>"user.name", "PWD"=>"K5zUtwDdzyX8T1vmvtEL");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn==true ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>
Other:
- The Site and SQL Server are on different machines
- Both boxes are Windows
- PHP was installed manually not through IIS
- Only error I receive is "500 Internal Server Error"
- I have installed the drivers from Microsoft
If there is anything I have left out please let me know and I will promptly provide it. I have been lost for quite some time, I am open to any suggestions.