使用odbc雄辩的外部laravel PHP7

I am using eloquent outside laravel. I have my own PHP application. This is what i am using https://github.com/illuminate/database

My config is as following

$settings3 = array(
'driver'    => 'odbc',
'dsn' => "Driver={SQL Server};Server={serverName};Trusted_Connection=true;Database=telesur_mis;",
'username' => 'user',
'password' => 'user',);

$capsule->addConnection($settings3,'teleappframework');

After executing this code I am getting the following error

Fatal error: Uncaught InvalidArgumentException: Unsupported driver [odbc]

I have PDO ODBC installed, i have also tested pdo odbc connection outside of eloquent. The reason for using ODBC is, because i am using PHP7 and currently there is no PDO extension for SQL Server.

Can anyone help me on this?

i would download FreeTDS and just use the regular sqlsrvr driver it works like a charm (if you are on a unix env) there is a lot of posts on how to configure it etc just look it up.

PHP7 has a few modules disabled by default that were previously enabled in PHP5.

Most likely running php -m does not show the modules you need.

It's an easy fix though since the extension should already exist in the \ext\ folder that came with PHP7. You just need to modify your php.ini file to include the line:

extension=php_pdo_odbc.dll
extension=php_odbc.dll

Then from a command prompt or terminal test again using php -m to see that the module is now listed.