<tfoot id='HDfeq'></tfoot>
  • <small id='HDfeq'></small><noframes id='HDfeq'>

        • <bdo id='HDfeq'></bdo><ul id='HDfeq'></ul>
        <legend id='HDfeq'><style id='HDfeq'><dir id='HDfeq'><q id='HDfeq'></q></dir></style></legend>
        <i id='HDfeq'><tr id='HDfeq'><dt id='HDfeq'><q id='HDfeq'><span id='HDfeq'><b id='HDfeq'><form id='HDfeq'><ins id='HDfeq'></ins><ul id='HDfeq'></ul><sub id='HDfeq'></sub></form><legend id='HDfeq'></legend><bdo id='HDfeq'><pre id='HDfeq'><center id='HDfeq'></center></pre></bdo></b><th id='HDfeq'></th></span></q></dt></tr></i><div id='HDfeq'><tfoot id='HDfeq'></tfoot><dl id='HDfeq'><fieldset id='HDfeq'></fieldset></dl></div>

        如何在 *nix 上将 Zend Framework 2 与 MS SQL Server 一起

        时间:2023-06-06

          <i id='tNHOd'><tr id='tNHOd'><dt id='tNHOd'><q id='tNHOd'><span id='tNHOd'><b id='tNHOd'><form id='tNHOd'><ins id='tNHOd'></ins><ul id='tNHOd'></ul><sub id='tNHOd'></sub></form><legend id='tNHOd'></legend><bdo id='tNHOd'><pre id='tNHOd'><center id='tNHOd'></center></pre></bdo></b><th id='tNHOd'></th></span></q></dt></tr></i><div id='tNHOd'><tfoot id='tNHOd'></tfoot><dl id='tNHOd'><fieldset id='tNHOd'></fieldset></dl></div>
        • <legend id='tNHOd'><style id='tNHOd'><dir id='tNHOd'><q id='tNHOd'></q></dir></style></legend>
          1. <small id='tNHOd'></small><noframes id='tNHOd'>

              <tbody id='tNHOd'></tbody>

              <bdo id='tNHOd'></bdo><ul id='tNHOd'></ul>
            • <tfoot id='tNHOd'></tfoot>
                • 本文介绍了如何在 *nix 上将 Zend Framework 2 与 MS SQL Server 一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  在非 Windows 操作系统上将 ZF2 与 MS SQL Server 结合使用的规范方法是什么(如果存在)?

                  What, if it exists, is the canonical way to use ZF2 with MS SQL Server on a non-Windows OS?

                  根据我从 文档中了解到的内容,官方只支持Sqlsrv驱动,仅适用于Windows平台.

                  From what I can tell from the documentation, only the Sqlsrv driver is officially supported, which only works on the Windows platform.

                  在 ZF1 中,我们使用了 Pdo_Mssql 适配器并将 pdoType 指定为 dblib.我找不到在 ZF2 中做类似事情的任何参考.

                  In ZF1, we used the Pdo_Mssql adapter and specified the pdoType as dblib. I can't find any references to doing anything similar in ZF2.

                  显然 前一段时间有一个 Pdo\Mssql 驱动程序,它在一个主要的 重构,但我没有看到当前记录的使用 Pdo_Dblib 的方法.

                  Apparently there was a Pdo\Mssql driver some time ago which was removed during a major refactoring, but I don't see a currently documented way of using Pdo_Dblib.

                  根据上面的适配器文档,您可以将适配器配置中的驱动程序设置为 Pdo=OtherPdoDriver,但是没有关于这种用法的文档示例.这是否意味着您可以使用 Pdo=Pdo_DblibPdo=dblib 并且它会自动运行?

                  According to the adapter documentation above, you can set the driver in the adapter config to Pdo=OtherPdoDriver, but there's no documented examples of this usage. Does that mean you can use Pdo=Pdo_Dblib or Pdo=dblib and it will work automagically?

                  我发现传递了对 PDO ODBC 驱动程序的引用,这将是一个可用的替代方法,但找不到任何文档或代码引用.

                  I've found passing references to a PDO ODBC driver, which would be a usable alternative, but can't find any documentation or code references.

                  推荐答案

                  安装 php5-sybase.确保安装了 freetds.您应该在 /etc/freetds 下有一个名为 freetds.conf 的 conf 文件.

                  Install the php5-sybase. Make sure that freetds is installed. You should have a conf file under /etc/freetds called freetds.conf.

                  在你的 freetds.conf 文件中,你应该像这样设置你的 mssql 连接:

                  In your freetds.conf file you should setup your mssql connection like this:

                  [MyMsSqlServer]
                  host = symachine.domain.com
                  port = 5000
                  tds version = 5.0
                  

                  然后,(此处以 ZF2 专辑教程为例)您可以像这样设置适配器:

                  Then, (using the ZF2 Albums Tutorial as an example here) you set up the adapter like this:

                  return array(
                      'db' => array(
                          'driver'         => 'Pdo',
                          'dsn'            => 'dblib:host=MyMsSqlServer;dbname=zf2tutorial',
                          'charset'        =>  'UTF-8',
                          'username'       => 'username',
                          'password'       => 'password',
                          'pdotype'       => 'dblib',
                      ),
                      'service_manager' => array(
                          'factories' => array(
                              'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
                          ),
                      ),
                  );
                  

                  看看这是否能帮助您找到任何地方并告诉我.我花了一段时间让它工作,我更乐意帮助其他有问题的人!!!

                  See if this gets you anywhere and let me know. I had a bitch of a time getting this to work, and I am more then happy to help anyone else that is having issues with this!!!

                  这篇关于如何在 *nix 上将 Zend Framework 2 与 MS SQL Server 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Zabbix 监控数据库文件大小 下一篇:如何在 zend db 上构建嵌套选择

                  相关文章

                  最新文章

                • <legend id='uYB0W'><style id='uYB0W'><dir id='uYB0W'><q id='uYB0W'></q></dir></style></legend>
                      <bdo id='uYB0W'></bdo><ul id='uYB0W'></ul>

                    1. <tfoot id='uYB0W'></tfoot>

                      <small id='uYB0W'></small><noframes id='uYB0W'>

                      <i id='uYB0W'><tr id='uYB0W'><dt id='uYB0W'><q id='uYB0W'><span id='uYB0W'><b id='uYB0W'><form id='uYB0W'><ins id='uYB0W'></ins><ul id='uYB0W'></ul><sub id='uYB0W'></sub></form><legend id='uYB0W'></legend><bdo id='uYB0W'><pre id='uYB0W'><center id='uYB0W'></center></pre></bdo></b><th id='uYB0W'></th></span></q></dt></tr></i><div id='uYB0W'><tfoot id='uYB0W'></tfoot><dl id='uYB0W'><fieldset id='uYB0W'></fieldset></dl></div>