What are the potential pitfalls when trying to establish a connection between IIS and MS SQL Server using PHP?

One potential pitfall when trying to establish a connection between IIS and MS SQL Server using PHP is not having the necessary PHP extensions enabled. To solve this, you need to ensure that the `sqlsrv` extension is enabled in your PHP configuration.

// Establish a connection to the MS SQL Server database
$serverName = "your_server_name";
$connectionOptions = array(
    "Database" => "your_database_name",
    "Uid" => "your_username",
    "PWD" => "your_password"
);

$conn = sqlsrv_connect($serverName, $connectionOptions);

if ($conn) {
    echo "Connection established successfully";
} else {
    echo "Connection could not be established";
}