Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Warning: PHP Startup: Unable to load dynamic library '- The specified procedure could not be found. in Unknown on line 0

Tags:

php

sql-server

I would like to change php version to 7.1 and i have an error:

PHP Warning:  PHP Startup: Unable to load dynamic library 

    'C:\Program Files\PHP\v7.1\ext\php_sqlsrv_7_nts_x86.dll' - The specified procedure could not be found.
     in Unknown on line 0

First think. This is not duplicate question because i checked many similar questions. I'm using IIS, PHP 7.1, and SQL server (thats why i need sqlsrv drivers). I checked php.ini file aready and i change extension-dir path to full path but nothing happens. (Logically if path is a problem why it works with other extensions? ). It works with PHP 7.0.7 (all enabled extensions is exactly same)

Update: still won't work but i tried to paste path from error message to file explorer and file already there.

like image 949
Klapsius Avatar asked Dec 02 '16 10:12

Klapsius


3 Answers

Turns out that PHP 7.0 and PHP 7.1 are not compatible and the mssql PDO drivers are for 7.0.

Github issue here

Also ensure you including the right 64/86 and ts/nts version.

like image 199
Toby Allen Avatar answered Nov 15 '22 03:11

Toby Allen


As from Toby Allen's accepted answer above 7.0 and 7.1 are incompatible,

However Microsoft has released Preview versions of the drivers for 7.1. This worked for me, hope it helps anyone searching.

Drivers can be found here under downloads

like image 22
Nyandika Avatar answered Nov 15 '22 02:11

Nyandika


I had this issue yesterday. The key to the error is the last bit.

The specified procedure could not be found.

In my case I went through a painful amount of debugging. The first thing that I noticed was that when I ran a hello world php file, I didn't get this error. That indicated to me it wasn't actually a problem loading the file, it was a problem calling a function in the file.

I went in and repeatedly put die() statements in and moved it until it hit the error. It took awhile but I eventually discovered I was calling sqlsrv_connect with options that were (apparently) now invalid.

So I can't say the exact cause of your issue without seeing the code that actually causes the error, but I hope this at least points you in the right direction.

like image 29
Andrew Avatar answered Nov 15 '22 03:11

Andrew