Ошибка команды переноса: Illuminate \ Database \ QueryException: не удалось найти драйвер на сервере SQL - PullRequest
0 голосов
/ 10 июля 2019

Я только что установил xampp version 3.2.4, Sql Server 2012, windows server 2012 R2, php version 7.3.6 и использую laravel as framework, и я получаю

Illuminate \ Database \ QueryException:не удалось найти драйвер (SQL: выберите * для системных объектов, где тип = 'U' и имя = миграция)

Я проверяю мой phpinfo() - detected pdo_sqlsrv,, и если я try make connection to sql server, нет проблем "Connection established".

<?php
$serverName = "VPS712345"; //serverName\instanceName, portNumber (default is 1433)
$connectionInfo = array( "Database"=>"newautocheck", "UID"=>"laravelxxxxx", "PWD"=>"xxxxxxxxxx");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

if( $conn ) {
     echo "Connection established.<br />";
}else{
     echo "Connection could not be established.<br />";
     die( print_r( sqlsrv_errors(), true));
}
?>

, но если я пытаюсь выполнить миграцию в базу данных, мой проект по-прежнему выдает ошибку команды

Illuminate\Database\QueryException  : could not find driver (SQL: select * fr
om sysobjects where type = 'U' and name = migrations)

  at C:\xampp\htdocs\testdulu\vendor\laravel\framework\src\Illuminate\Database\C
onnection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll
 format the error
    661|         // message to include the bindings with SQL, which will make th
is exception a
    662|         // lot more helpful to the developer instead of just the databa
se's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   Doctrine\DBAL\Driver\PDOException::("could not find driver")
      C:\xampp\htdocs\testdulu\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO
Connection.php:31

  2   PDOException::("could not find driver")
      C:\xampp\htdocs\testdulu\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO
Connection.php:27

  Please use the argument -v to see more details.

может помочь мне, как перенести этот проект

...