laravel连sql server报invalid handle returned问题解决方案

https://github.com/Microsoft/msphpsql/issues/116

4.1.1驱动下载地址

https://github.com/Microsoft/msphpsql/releases/tag/v4.1.1-Windows

还有一说是

在数据库配置中加入 ‘pooling’ => false

‘sqlsrv’ => [
‘driver’   => ‘sqlsrv’,
‘host’     => ‘xxx’,
‘database’ => ‘xxx’,
‘username’ => ‘xxx’,
‘password’ => ‘xxx’,
‘charset’  => ‘utf8’,
‘prefix’   => ”,
‘pooling’ => false

],

或者

注释掉port这一行

'connections' => [
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env( 'DB_HOST' ),
'port' => '', // THIS LINE
'database' => env( 'DB_DATABASE' ),
'username' => env( 'DB_USERNAME' ),
'password' => env( 'DB_PASSWORD' ),
'prefix' => '',
'charset' => 'UTF-8',
'pooling' => false,
],
],
上一篇:thinkphp项目目录


下一篇:thinkphp应用目录不可写,目录无法自动生成! 请手动生成项目目录~