Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 7 on IIS: Call_user_function could not be located

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.

like image 683
MEmerson Avatar asked Dec 09 '16 20:12

MEmerson


4 Answers

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

Complete Setup:

  • Windows 10 Pro
  • PHP X64 7.0.12 TS (Bitnami WAMP Stack)
  • Microsoft ODBC Driver 13.1 for SQL Server (https://msdn.microsoft.com/en-us/library/mt703139(v=sql.1).aspx)
  • Microsoft Drivers for PHP for SQL Server 4.0 (https://www.microsoft.com/en-ca/download/details.aspx?id=20098)

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

like image 126
NoCopy Avatar answered Oct 28 '22 07:10

NoCopy


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.

like image 38
DropDropped Avatar answered Oct 28 '22 05:10

DropDropped


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.

like image 30
Ivan P. Avatar answered Oct 28 '22 07:10

Ivan P.


Same as NoCopy

  • Windows Server 2012
  • php-7.0.15-Win32-VC14-x64.zip from (http://windows.php.net/download)
  • Visual C++ Redistributable for Visual Studio 2015 (https://www.microsoft.com/en-us/download/details.aspx?id=48145)
  • Microsoft ODBC Driver 13.1 for SQL Server
  • Microsoft Drivers for PHP for SQL Server 4.0

7.1.x still a No,NO from Microsoft

like image 1
jmcollantes Avatar answered Oct 28 '22 06:10

jmcollantes