Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Startup: Unable to load dynamic library 'sqlsrv'

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
like image 979
Kevin Jones Avatar asked Sep 02 '25 14:09

Kevin Jones


1 Answers

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

like image 78
Kevin Jones Avatar answered Sep 05 '25 03:09

Kevin Jones