#!/usr/bin/env php 'SqlPassword', 'ConnectRetryCount' => 0, 'Database' => 'example', 'LoginTimeout' => 1, // string for PDO_SQLSRV 'UID' => 'userName', // not for PDO_SQLSRV 'PWD' => 'password', ] ); $errors = sqlsrv_errors(SQLSRV_ERR_ALL); if (is_array($errors)) { foreach ($errors as $error) { if (isset($error['message']) && stripos($error['message'], 'This extension requires the Microsoft ODBC Driver for SQL Server') !== false) { fwrite(STDERR, trim($error['message']) . "\n"); } } }