i'm running Laravel with the xampp terminal(i executed xampp as Administrator ), my connection sqlsrv is working with a normal php script but not with laravel. i have xampp with php 7.3 and the last version of laravel. what i'm missing?? i configured .env with my connection parameeters:
DB_CONNECTION=sqlsrv
DB_HOST=mydomain.com
DB_PORT=1433
DB_DATABASE=xxxxx
DB_USERNAME=xxxxx
DB_PASSWORD=xxxxx
and config/database.php
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
],
when i try to execute php artisan migrate i get this error:
could not find driver (SQL: select * from sysobjects where type = 'U' and name = migrations)
at C:\xampp\htdocs\m2connector\vendor\laravel\framework\src\Illuminate\Database\Connection.php:665
661| // If an exception occurs when attempting to run a query, we'll format the error
662| // message to include the bindings with SQL, which will make this exception a
663| // lot more helpful to the developer instead of just the database's errors.
664| catch (Exception $e) {
> 665| throw new QueryException(
666| $query, $this->prepareBindings($bindings), $e
667| );
668| }
669|
Exception trace:
1 PDOException::("could not find driver")
C:\xampp\htdocs\m2connector\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
2 PDO::__construct("dblib:host=xxxxxx:1433;dbname=xxxxx;charset=utf8mb4", "xxxxx", "xxxxxx", [])
C:\xampp\htdocs\m2connector\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
Please use the argument -v to see more details.