doujin8673 2016-01-28 11:20
浏览 185

使用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?

  • 写回答

2条回答 默认 最新

  • dongyi3776 2016-01-28 13:03
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)