Laravel SQL Server驱动程序错误000000000

问题描述 投票:1回答:2

在Laravel中获得SQL-Server Connection error

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9VZm1RbS5qcGcifQ==” alt =“ SQL Server驱动程序错误”>

我包括php_pdo_sqlsrv_74_ts.dllphp_sqlsrv_74_ts。我也更新了php.ini。但是,仍然无法解决此错误。

php laravel
2个回答
1
投票

您正在尝试连接mysql驱动程序。您的错误消息表明此驱动程序不可用。

检查您的服务器上是否安装了mysql扩展。

在Ubuntu / Debian中,您使用以下命令检查软件包:

dpkg --get-selections | grep php | grep mysql

如果没有,请安装php-mysql软件包。

在Ubuntu / Debian中,您可以使用:

PHP7:

 sudo apt-get install php7.2-mysql

您将需要重新启动网络服务器:

sudo /etc/init.d/nginx restart

0
投票

您可以通过下面的链接下载所有Windows PHP SQL Server:-

Windows PHP SQL Server Driver

记住要复制正确的PHP版本和正确的系统位[32位的x86 / 64位的x64] .dll粘贴到php / ext文件夹

然后在php.ini中启用了dll

extension = [driver].dll

此后,需要根据下表安装正确版本的ODBC驱动程序:-

enter image description here

Latest ODBC Driver Downloads Page

Previous Version ODBC Driver Downloads Page

Final step, don't forget to restart Apache server before do all kind of testing.
© www.soinside.com 2019 - 2024. All rights reserved.