Laravel not working with MSSQL
-
Hello,
I have a problem integration laravel with mssql. A message appears to me
the driver can not be found (SQL: choose * from [users])I have configured php.ini appropriately, adding the amount
extension = sqlsrv_72_ts_x86Interestingly, the script was made outside laravel and displays data from the database.
So the php configuration is correct.
Thank you for suggestions and advice.
-
@Tomasz : Do you think it is a bug in Laravel? I think so.
-
It looks like it, it's a pity because I'm standing with the implementation of the project.
-
@Tomasz : You can debug to figure out or create another project that can connect to MSSQL and use it as API.
-
For Ms-Sql you need to install ODBC-Drivers as well. I was missing this step and searched the whole internet without luck.
-
As part of the test, I created a clean project with one controllere, view etc. and I also like the error
-
@Tomasz odbc drivers in place? https://docs.microsoft.com/de-de/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-2017
-
Yes i change my connection on:
'odbc' => [
'driver' => 'sqlsrv',
'odbc' => true,
'odbc_datasource_name' => '{SQL Server}',
'host' => '{127.0.0.1\DB_TEST}',
'database' => 'meteor',
'username' => 'DESKTOP-B9M4O7M\admin',
'password' => 'secret', ],and connection work ok. Thank you.
-
I was having the same issue, and am very new to PHP and Laragon.
Hopefully this helps others.
The ODBC driver needs to be installed on the local machine you are running Laragon. Its not an extension for ODBC in the PHP settings.
I had a lot of conflicts installing the ODBC version 17 but version 11 also supports the PHP MSSQL extensions for 7.2.
As soon as I installed that, without a hitch, everything was working great.