I'm trying to get my first Laravel project running with a freshly installed SQL Server instance, and my normal connections work. However, in Laravel, I get the error message "could not find driver" when I run the environment server with php:artisan serve.
Illuminate \ Database \ QueryException PHP 8.2.15 11.0.8 could not find driver SELECT top 1 * FROM [ sessions ] WHERE [ id ] = FnziuCl4Bh7mfDbUW4F3E0OQKfryNLEd21vPSyF3
php.ini shows me that SQL Server is enabled:
sqlsrv
sqlsrv support enabled
ExtensionVer 5.11.1+17301
Directive Local Value Master Value
sqlsrv.ClientBufferMaxKBSize 10240 10240
sqlsrv.LogSeverity 0 0
sqlsrv.LogSubsystems 0 0
sqlsrv.WarningsReturnAsErrors On On`
.env
DB_CONNECTION=sqlsrv
DB_HOST=192.168.xx.xx
DB_PORT=1433
DB_DATABASE=webdev_laravel
DB_USERNAME=webdev_applikation
DB_PASSWORD=password
I tried the following:
- server restart
- clear cache
I read a lot of other threads with the same error, but I don't want to use PDO, and I think it's optional, or isn't it?