找不到php pdo的ODBC驱动程序

时间:2018-01-10 07:55:04

标签: php pdo odbc driver

<table>
  <tr class="h">
    <th colspan="2">Module Authors</th>
  </tr>
  <tr class="h">
    <th>Module</th>
    <th>Authors</th>
  </tr>
  <tr>
    <td class="e">BC Math </td>
    <td class="v">Andi Gutmans </td>
  </tr>
  <tr>
    <td class="e">Bzip2 </td>
    <td class="v">Sterling Hughes </td>
  </tr>
  <tr>
    <td class="e">Calendar </td>
    <td class="v">Shane Caraveo, Colin Viebrock, Hartmut Holzgraefe, Wez Furlong </td>
  </tr>
  <tr>
    <td class="e">COM and .Net </td>
    <td class="v">Wez Furlong </td>
  </tr>
  <tr>
    <td class="e">ctype </td>
    <td class="v">Hartmut Holzgraefe </td>
  </tr>
  <tr>
    <td class="e">cURL </td>
    <td class="v">Sterling Hughes </td>
  </tr>
  <tr>
    <td class="e">Date/Time Support </td>
    <td class="v">Derick Rethans </td>
  </tr>
  <tr>
    <td class="e">DB-LIB (MS SQL, Sybase) </td>
    <td class="v">Wez Furlong, Frank M. Kromann, Adam Baratz </td>
  </tr>
  <tr>
    <td class="e">DBA </td>
    <td class="v">Sascha Schumann, Marcus Boerger </td>
  </tr>
  <tr>
    <td class="e">DOM </td>
    <td class="v">Christian Stocker, Rob Richards, Marcus Boerger </td>
  </tr>
  <tr>
    <td class="e">enchant </td>
    <td class="v">Pierre-Alain Joye, Ilia Alshanetsky </td>
  </tr>
  <tr>
    <td class="e">EXIF </td>
    <td class="v">Rasmus Lerdorf, Marcus Boerger </td>
  </tr>
  <tr>
    <td class="e">fileinfo </td>
    <td class="v">Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans, Anatol Belski </td>
  </tr>
  <tr>
    <td class="e">Firebird driver for PDO </td>
    <td class="v">Ard Biesheuvel </td>
  </tr>
  <tr>
    <td class="e">FTP </td>
    <td class="v">Stefan Esser, Andrew Skalski </td>
  </tr>
  <tr>
    <td class="e">GD imaging </td>
    <td class="v">Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger </td>
  </tr>
  <tr>
    <td class="e">GetText </td>
    <td class="v">Alex Plotnick </td>
  </tr>
  <tr>
    <td class="e">GNU GMP support </td>
    <td class="v">Stanislav Malyshev </td>
  </tr>
  <tr>
    <td class="e">Iconv </td>
    <td class="v">Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi </td>
  </tr>
  <tr>
    <td class="e">IMAP </td>
    <td class="v">Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky </td>
  </tr>
  <tr>
    <td class="e">Input Filter </td>
    <td class="v">Rasmus Lerdorf, Derick Rethans, Pierre-Alain Joye, Ilia Alshanetsky </td>
  </tr>
  <tr>
    <td class="e">InterBase </td>
    <td class="v">Jouni Ahto, Andrew Avdeev, Ard Biesheuvel </td>
  </tr>
  <tr>
    <td class="e">Internationalization </td>
    <td class="v">Ed Batutis, Vladimir Iordanov, Dmitry Lakhtyuk, Stanislav Malyshev, Vadim Savchuk, Kirti Velankar </td>
  </tr>
  <tr>
    <td class="e">JSON </td>
    <td class="v">Jakub Zelenka, Omar Kilani, Scott MacVicar </td>
  </tr>
  <tr>
    <td class="e">LDAP </td>
    <td class="v">Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas </td>
  </tr>
  <tr>
    <td class="e">LIBXML </td>
    <td class="v">Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo </td>
  </tr>
  <tr>
    <td class="e">Multibyte String Functions </td>
    <td class="v">Tsukada Takuya, Rui Hirokawa </td>
  </tr>
  <tr>
    <td class="e">MySQL driver for PDO </td>
    <td class="v">George Schlossnagle, Wez Furlong, Ilia Alshanetsky, Johannes Schlueter </td>
  </tr>
  <tr>
    <td class="e">MySQLi </td>
    <td class="v">Zak Greant, Georg Richter, Andrey Hristov, Ulf Wendel </td>
  </tr>
  <tr>
    <td class="e">MySQLnd </td>
    <td class="v">Andrey Hristov, Ulf Wendel, Georg Richter, Johannes Schlüter </td>
  </tr>
  <tr>
    <td class="e">OCI8 </td>
    <td class="v">Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong, Christopher Jones, Oracle Corporation </td>
  </tr>
  <tr>
    <td class="e">ODBC driver for PDO </td>
    <td class="v">Wez Furlong </td>
  </tr>
  <tr>
    <td class="e">ODBC </td>
    <td class="v">Stig Bakken, Andreas Karajannis, Frank M. Kromann, Daniel R. Kalowsky </td>
  </tr>
  <tr>
    <td class="e">Opcache </td>
    <td class="v">Andi Gutmans, Zeev Suraski, Stanislav Malyshev, Dmitry Stogov, Xinchen Hui </td>
  </tr>
  <tr>
    <td class="e">OpenSSL </td>
    <td class="v">Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar </td>
  </tr>
  <tr>
    <td class="e">Oracle (OCI) driver for PDO </td>
    <td class="v">Wez Furlong </td>
  </tr>
  <tr>
    <td class="e">pcntl </td>
    <td class="v">Jason Greene, Arnaud Le Blanc </td>
  </tr>
  <tr>
    <td class="e">Perl Compatible Regexps </td>
    <td class="v">Andrei Zmievski </td>
  </tr>
  <tr>
    <td class="e">PHP Archive </td>
    <td class="v">Gregory Beaver, Marcus Boerger </td>
  </tr>
  <tr>
    <td class="e">PHP Data Objects </td>
    <td class="v">Wez Furlong, Marcus Boerger, Sterling Hughes, George Schlossnagle, Ilia Alshanetsky </td>
  </tr>
  <tr>
    <td class="e">PHP hash </td>
    <td class="v">Sara Golemon, Rasmus Lerdorf, Stefan Esser, Michael Wallner, Scott MacVicar </td>
  </tr>
  <tr>
    <td class="e">Posix </td>
    <td class="v">Kristian Koehntopp </td>
  </tr>
  <tr>
    <td class="e">PostgreSQL driver for PDO </td>
    <td class="v">Edin Kadribasic, Ilia Alshanetsky </td>
  </tr>
  <tr>
    <td class="e">PostgreSQL </td>
    <td class="v">Jouni Ahto, Zeev Suraski, Yasuo Ohgaki, Chris Kings-Lynne </td>
  </tr>
  <tr>
    <td class="e">Pspell </td>
    <td class="v">Vlad Krupin </td>
  </tr>
  <tr>
    <td class="e">Readline </td>
    <td class="v">Thies C. Arntzen </td>
  </tr>
  <tr>
    <td class="e">Recode </td>
    <td class="v">Kristian Koehntopp </td>
  </tr>
  <tr>
    <td class="e">Reflection </td>
    <td class="v">Marcus Boerger, Timm Friebe, George Schlossnagle, Andrei Zmievski, Johannes Schlueter </td>
  </tr>
  <tr>
    <td class="e">Sessions </td>
    <td class="v">Sascha Schumann, Andrei Zmievski </td>
  </tr>
  <tr>
    <td class="e">Shared Memory Operations </td>
    <td class="v">Slava Poliakov, Ilia Alshanetsky </td>
  </tr>
  <tr>
    <td class="e">SimpleXML </td>
    <td class="v">Sterling Hughes, Marcus Boerger, Rob Richards </td>
  </tr>
  <tr>
    <td class="e">SNMP </td>
    <td class="v">Rasmus Lerdorf, Harrie Hazewinkel, Mike Jackson, Steven Lawrance, Johann Hanne, Boris Lytochkin </td>
  </tr>
  <tr>
    <td class="e">SOAP </td>
    <td class="v">Brad Lafountain, Shane Caraveo, Dmitry Stogov </td>
  </tr>
  <tr>
    <td class="e">Sockets </td>
    <td class="v">Chris Vandomelen, Sterling Hughes, Daniel Beulshausen, Jason Greene </td>
  </tr>
  <tr>
    <td class="e">Sodium </td>
    <td class="v">Frank Denis </td>
  </tr>
  <tr>
    <td class="e">SPL </td>
    <td class="v">Marcus Boerger, Etienne Kneuss </td>
  </tr>
  <tr>
    <td class="e">SQLite 3.x driver for PDO </td>
    <td class="v">Wez Furlong </td>
  </tr>
  <tr>
    <td class="e">SQLite3 </td>
    <td class="v">Scott MacVicar, Ilia Alshanetsky, Brad Dewar </td>
  </tr>
  <tr>
    <td class="e">System V Message based IPC </td>
    <td class="v">Wez Furlong </td>
  </tr>
  <tr>
    <td class="e">System V Semaphores </td>
    <td class="v">Tom May </td>
  </tr>
  <tr>
    <td class="e">System V Shared Memory </td>
    <td class="v">Christian Cartus </td>
  </tr>
  <tr>
    <td class="e">tidy </td>
    <td class="v">John Coggeshall, Ilia Alshanetsky </td>
  </tr>
  <tr>
    <td class="e">tokenizer </td>
    <td class="v">Andrei Zmievski, Johannes Schlueter </td>
  </tr>
  <tr>
    <td class="e">WDDX </td>
    <td class="v">Andrei Zmievski </td>
  </tr>
  <tr>
    <td class="e">XML </td>
    <td class="v">Stig Bakken, Thies C. Arntzen, Sterling Hughes </td>
  </tr>
  <tr>
    <td class="e">XMLReader </td>
    <td class="v">Rob Richards </td>
  </tr>
  <tr>
    <td class="e">xmlrpc </td>
    <td class="v">Dan Libby </td>
  </tr>
  <tr>
    <td class="e">XMLWriter </td>
    <td class="v">Rob Richards, Pierre-Alain Joye </td>
  </tr>
  <tr>
    <td class="e">XSL </td>
    <td class="v">Christian Stocker, Rob Richards </td>
  </tr>
  <tr>
    <td class="e">Zip </td>
    <td class="v">Pierre-Alain Joye, Remi Collet </td>
  </tr>
  <tr>
    <td class="e">Zlib </td>
    <td class="v">Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti, Michael Wallner </td>
  </tr>
</table>

当我试图回复phpinfo()时,我得到了上面的模块表,但当我尝试print_r(PDO::getAvailableDrivers());时,我只得到

Array
(
    [0] => mysql
    [1] => sqlite
)

我不明白为什么ODBC不在列表中。所以当我有这个连接时

$this->_connection = new PDO("odbc:Driver={SQL Server};Server=$serverName,1433; Database=".DB_NAME.";",DB_USER,DB_PASS);

它没有进入连接我返回错误的ODBC驱动程序,它说

  

抓到异常:找不到驱动程序

我认为它是ODBC驱动程序

1 个答案:

答案 0 :(得分:0)

$this->_connection = odbc_connect("Driver={SQL Server};Server=$server;Database=$database", $username, $password, SQL_CUR_USE_ODBC);