In what situations would it be necessary to restart the web server after making changes to the PHP configuration for MSSQL connectivity?

When making changes to the PHP configuration for MSSQL connectivity, it may be necessary to restart the web server in order for the changes to take effect. This is because the web server needs to reload the PHP configuration file to apply the modifications. Restarting the web server ensures that the changes are properly implemented and the PHP script can connect to the MSSQL database successfully.

// Sample PHP code snippet to connect to MSSQL database
$serverName = "localhost";
$connectionInfo = array("Database" => "dbName", "UID" => "username", "PWD" => "password");
$conn = sqlsrv_connect($serverName, $connectionInfo);

if ($conn) {
    echo "Connected to MSSQL database";
} else {
    echo "Connection failed";
}