phpsql-serveriissqlsrv

Could not find driver sqlsrv PHP 8.0.1


I´m currently trying to enable the pdo_sqlsrv extension.

I downloaded the drivers from here: https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server?view=sql-server-ver15

And then added them to the folder php/ext/

After that i added the following line to the php.ini

extension=php_sqlsrv_72_ts.dll

The error log shows me the following:

[12-Jan-2021 16:06:23 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_sqlsrv_72_ts.dll' (tried: C:\php\ext\php_sqlsrv_72_ts.dll (Impossível localizar o módulo especificado), C:\php\ext\php_php_sqlsrv_72_ts.dll.dll (Impossível localizar o módulo especificado)) in Unknown on line 0

I already tried also just add the following line:

extension=php_pdo_sqlsrv

The error log file shows:

[12-Jan-2021 16:17:55 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv' (tried: C:\php\ext\php_pdo_sqlsrv (Impossível localizar o módulo especificado), C:\php\ext\php_php_pdo_sqlsrv.dll (Impossível localizar o módulo especificado)) in Unknown on line 0

Note: Im using PHP with IIS. Also others drivers like pdo_odbc work. I only have problems with this one.

After following suggesting from comments:

I isntalled the drivers from the following link: pecl.php.net/package/pdo_sqlsrv/5.9.0beta2/windows

Added to php.ini

extension=pdo_sqlsrv

And error log file stills says it can't find the module:

[12-Jan-2021 20:59:17 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_sqlsrv' (tried: C:\php\ext\pdo_sqlsrv (Impossível localizar o módulo especificado), C:\php\ext\php_pdo_sqlsrv.dll (Impossível localizar o módulo especificado)) in Unknown on line 0

Solution

  • From what I read after the release of PHP 8, the dll extentsion for pdo_sqlsrv won't be out until the end of January. I had the same issue when 7.4 rolled out and I had to wait a couple months for the appropriate dll to be release for our Windows server. I'll try and remember to come back and update with the link if I find it released.