exception 'PDOException' with message 'could not find driver' SQLSRV Laravel Artisan CLI

前端 未结 2 690
挽巷
挽巷 2021-01-03 01:54

I am running php 5.5 on a Windows Server 2008. I am using the Laravel 4.0 framework for the application. I am connecting to a SQL SRV database via PDO, when executed via htt

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 02:43

    The answer above is correct, but just to clarify:

    1. Open your console and execute:

      php -i | grep "Loaded Configuration File"

    2. That will give you the folder directory where you php-cli.ini is (Laravel Commands use a different php.ini than the one used by HTTP requests)

    3. Go to that file, and make sure it has this:

      extension=php_pdo_mysql.dll

    4. Restart your server and try again. That worked for me, hope it helps.

提交回复
热议问题