Mac上缺少PDO驱动程序

时间:2019-02-15 07:43:31

标签: sql-server pdo macos-sierra php-5.6 symfony-2.6

我正在尝试从我的Symfony 2.6项目连接到mssql数据库。我的项目和系统信息如下

macOS Sierra 10.12.6

Symfony 2.6

php 5.6.37

几年前,我能够通过遵循

实现这一目标

在终端上运行“ brew install freetds”和“ brew install php56-pdo-dblib”。按照Connection to a MS SQL Server from Symfony / Doctrine on Mac or Linux中的步骤进行操作。

但是当我运行“ brew install php56-pdo-dblib”时,请放开。我正在

No available formula with the name "php56-pdo-dblib" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

我在Symfony中遇到的异常是

PDOException object {
  message => (string) could not find driver
  *Exception*string => (string)
  code => (int) 0
  file => (string) /Applications/MAMP/htdocs/myproject/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
  line => (int) 41
  *Exception*trace => array(25) (
    [0] => array(6) (
      [file] => (string) /Applications/MAMP/htdocs/myproject/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php
      [line] => (int) 41
      [function] => (string) __construct
      [class] => (string) PDO
      [type] => (string) ->
      [args] => array(4) (
      )
    )
    [1] => array(6) (
      [file] => (string) /Applications/MAMP/htdocs/myproject/vendor/isoft/mssql-bundle/Realestate/MssqlBundle/Driver/PDODblib/Driver.php
      [line] => (int) 42
      [function] => (string) __construct
      [class] => (string) Doctrine\DBAL\Driver\PDOConnection
      [type] => (string) ->
      [args] => array(4) (
      )
    )
    [2] => array(6) (
      [file] => (string) /Applications/MAMP/htdocs/myproject/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
      [line] => (int) 356
      [function] => (string) connect
      [class] => (string) Realestate\MssqlBundle\Driver\PDODblib\Driver
      [type] => (string) ->
      [args] => array(4) (
      )
    )

找不到任何东西可以解决它,希望有人可以引导我找出来:)。

谢谢

0 个答案:

没有答案