I'm trying to connect to a MsSQL server database with php pdo, but I get this error:
Could not find driver.
I've tried all solutions on stackoverflow none of them worked.
Installed php driver and configured php.ini. added these one by one:
extension=php_pdo_sqlsrv_71_ts.dll
extension=php_sqlsrv_71_ts.dll
extension=php_pdo_sqlsrv_71_nts.dll
and all of them at once.
Used the pdo_dblib_mssql class: https://www.php.net/manual/en/ref.pdo-dblib.php.
Used different PDO constructors:
$conn = new PDO ("dblib:host=$hostname:$port;dbname=dbname","username","pwd");
and
$conn = new PDO("sqlsrv:Server=$servername;Database=dbname", "username", "pwd");
Nothing worked, any help would be appreciated.
PHP version : 7.1.27 / MsSQL SERVER 2014.