6

I am trying to use the Microsoft SQL Server drivers with PHP 7.1 Not Thread Safe x64 on Windows 2012 R2 64-bit server.

No matter what I do I am getting an error when I run php from a admin command prompt

Warning: PHP Startup: Unable to load dynamic library 'ext\php_pdo_sqlsrv_7_nts.dll' - The specified procedure could not be found.

Additionally it display a windows pop up that states

The procedure entry point call_user_function could not be located in the dynamic link library C:\PHP7\ext\php_pdo_dqlsrv7_nts_x64.dll

I have verified that the php.ini is pointing to a file that exists, because if I rename the .dll file, the error messages changes to "specified module could not be found", instead of specified procedure.

I have installed Microsoft Visual C++ runtime 15 x64 as required by PHP 7.

I have installed Microsoft ODBC driver 13 as required by the Microsoft SQL Server driver.

I have rebooted the server twice.

There is nothing else I can think to even try. The Microsoft WinCache.dll is loading and working fine in PHP, as verified by phpinfo.

MEmerson
  • 772
  • 1
  • 6
  • 17

5 Answers5

9

Confirmed what @MEmerson said above. You need to downgrade PHP to 7.0.X(?) - I used 7.0.12.

Complete Setup:

Same drivers with PHP X64 7.1.0 produced the error you are getting.

NoCopy
  • 108
  • 4
9

Microsoft Drivers 4.3 for PHP for SQL Server are now available. These drivers contains files for PHP 7.1 - php_pdo_sqlsrv_71_nts_x64.dll etc. I've successfully managed to connect to SQL server.

DropDropped
  • 1,253
  • 1
  • 22
  • 50
  • 1
    [Microsoft Drivers 5.3 for PHP for SQL Server](https://www.microsoft.com/en-us/download/confirmation.aspx?id=57163) for PHP 7.2 - php_pdo_sqlsrv_72_nts_x64.dll – Micah Oct 31 '18 at 20:20
2

Had similar error when tried to use httpd (Apache), PHP 7.2.2, Microsoft ODBC driver 11 on MS Windows Server 2012. The text of error was:

The procedure entry point call_user_function could not be located in the dynamic link library php_pdo_sqlsrv_7_ts_x64.dll.

when I called php -m to check modules.

So I have downloaded Windows-7.2.zip from https://github.com/Microsoft/msphpsql/releases and used thread-safe dlls from it.

php -m works now as it should without giving error.

Ivan P.
  • 832
  • 2
  • 9
  • 26
1

Same as NoCopy

7.1.x still a No,NO from Microsoft

jmcollantes
  • 84
  • 1
  • 8
0

It happened to me today while enabling the extensions in the IIS, where I by mistake enabled different versions for pdo & driver extensions (E.g. php_sqlsrv_7_nts_x86.dll for PHP 7.0 & php_pdo_sqlsrv_72_nts_x86.dll for PHP 7.2).

Usually the package that you download from Microsoft that contains Microsoft Drivers 5.3 for PHP for SQL Server has all the PHP extensions versions. https://www.microsoft.com/en-us/download/details.aspx?id=57163

Just make sure you enable both extensions for the same versions to avoid that error.