3
votes

I keep getting this error when trying to use "php artisan migrate"

PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv' (tried: E:\xampp\php\ext\sqlsrv (The specified module could not be found), E:\xampp\php\ext\php_sqlsrv.dll (The specified module could not be found)) in Unknown on line 0

I'm using laravel and trying to connect to SQL Server

I'm using PHP 8.0 and using this https://pecl.php.net/package/sqlsrv/5.9.0beta2/windows for the sql driver.

In particular I'm using "7.4 Thread Safe (TS) x64" dll file.

I looked at many other questions with similar problems and cant get anything to work.

If you need more information let me know!

Edit: this is my php.int:

extension=php_sqlsrv.dll
1
Seems you are using Windows Platform. Please check whether the file "php_sqlsrv.dll" exists in your E:\xampp\php\ext folder - Ken Lee
it does exist in my folder - Kevin Jones
did you reboot your machine after adding php_sqlsrv.dll in your php.ini file ? - Ken Lee
Please double check whether the dll you are using is correct (32 bit / 64 bit) - Ken Lee
If the driver is not working. Please try to using MS's driver: docs.microsoft.com/en-us/sql/connect/php/… - Ken Lee

1 Answers

1
votes

For those who may have this problem as well.

Make sure you download the right dll for your php version.

Go here:

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

On the latest release, click asset at the bottom and download the right dll for your php version