Msphpsql: php_pdo_sqlsrv_71_nts_x86.dll specified module not found

Created on 10 Dec 2016  Â·  10Comments  Â·  Source: microsoft/msphpsql

Environment is a
Surface Book with Windows 10 including the anniversary update
PHP 7.1
SQL Server 2016 Developer
MS ODBC 13.1

PHP error log references the correct 71 DLL in the ext folder, but is throwing the same error as before the 71 drivers were loaded.

PHP Startup: Unable to load dynamic library 'C:\Util\PHP\7.1\ext\php_pdo_sqlsrv_71_nts_x86.dll' - The specified module could not be found in Unknown on line 0

Windows

Most helpful comment

It is. That was the first thing I checked.

From the PHP.INI:
extension_dir = "C:\Util\PHP\7.1\ext"

; Misc Extentions
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_openssl.dll
extension=php_soap.dll
extension=php_fileinfo.dll
extension=php_com_dotnet.dll
extension=php_pdo_sqlsrv_71_nts_x86.dll

From the error_log:
[10-Dec-2016 17:39:52 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Util\PHP\7.1\ext\php_pdo_sqlsrv_71_nts_x86.dll' - The specified module could not be found.
in Unknown on line 0
[10-Dec-2016 12:39:52 America/New_York] "could not find driver"

All 10 comments

Is the PHP 7.1 64 bit or 32 bit? 'Unable to load dynamic library' is usually thrown when the file path is not correct. Can you verify that the dll is in the correct folder?

PHP 7.1 is the 32-bit x86 version extracted from php-7.1.0-nts-Win32-VC14-x86.zip.

The correct full path and file name are being referenced in the the PHP error log as shown in the original post.

Thanks.

Can you confirm that php.ini is correctly configured? “extension_dir” should be set to where the dll is dropped, and SQLSRV extension name should be added to the list of extensions by setting “extension=php_pdo_sqlsrv_71_nts.dll”.

It is. That was the first thing I checked.

From the PHP.INI:
extension_dir = "C:\Util\PHP\7.1\ext"

; Misc Extentions
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_openssl.dll
extension=php_soap.dll
extension=php_fileinfo.dll
extension=php_com_dotnet.dll
extension=php_pdo_sqlsrv_71_nts_x86.dll

From the error_log:
[10-Dec-2016 17:39:52 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Util\PHP\7.1\ext\php_pdo_sqlsrv_71_nts_x86.dll' - The specified module could not be found.
in Unknown on line 0
[10-Dec-2016 12:39:52 America/New_York] "could not find driver"

I am not able to reproduce the issue, how are you getting the binaries? Can you try the 7.1 binaries from 4.1.4 release? also the name of the binary doesn't include _x86 at the end.

+1
@dbasri Can you change the extension=php_pdo_sqlsrv_71_nts_x86.dll to extension=php_pdo_sqlsrv_71_nts.dll

OK, egg on my face. The 7.0 drivers had _x86 in the DLL file name, but the 7.1 driver does not. That worked. Thank you very much.

Had this issue as well. I was trying to use the nts (non-thread safe) when it was expecting ts (thread safe) version to be used!

SQL Server DLL file with PHP 7.2 version

https://github.com/Microsoft/msphpsql/releases

To download Windows DLLs for PHP 7.1 or above from the PECL repository, please go to the SQLSRV or PDO_SQLSRV PECL page.

Many times it has to do with the way you relate within the "php.ini" file.
Did you try adding the ".dll" extension?

Example:
"extension = php_sqlsrv_74_ts_x64" should be left as "extension = php_sqlsrv_74_ts_x64.dll"

Was this page helpful?
0 / 5 - 0 ratings