【问题标题】:PDO DBLIB Driver for MS SQL Server : Cannot find php_pdo_driver.h适用于 MS SQL Server 的 PDO DBLIB 驱动程序:找不到 php_pdo_driver.h
【发布时间】:2018-10-03 19:04:35
【问题描述】:

我正在按照下面链接上的教程在我的 Mac Os Mojave 中编译 PDO 的 DBLIB 驱动程序。

https://github.com/BellevueCollege/public-docs/blob/master/PHP/configure-mssql-pdodblib-mac.md

问题是,当我运行下面的代码时:

$ cd php-7.2.9/ext/pdo_dblib
$ phpize
$ ./configure --with-php-config=/usr/bin/php-config --with-pdo-dblib=/usr/local/
$ make
$ sudo cp modules/pdo_dblib.so /usr/lib/php/extensions/no-debug-non-zts-20121212

特别是关于这个命令:

$ ./configure --with-php-config=/usr/bin/php-config --with-pdo-dblib=/usr/local/

我收到此错误:

configure: error: Cannot find php_pdo_driver.h.

有什么想法吗?过去 2 小时我一直在尝试:/

谢谢

【问题讨论】:

    标签: php sql-server pdo homebrew


    【解决方案1】:

    实际上 PDO 包含在 PHP 核心中。您必须安装 PHP 和 MySQL 捆绑包。

    并按照以下步骤安装dblib PDO DBLIB Driver for MS SQL Server : Cannot find php_pdo_driver.h

    还请查看此解决方案: error: cannot find php_pdo_driver.h while installing pdo_mysql

    【讨论】:

    • 谢谢,但我正在尝试安装 DBLIB,而不是 My SQL。
    • 我不明白,答案继续引用 sybase ? “sudo apt-get install php5-sybase”
    • 此外,当我运行 'sudo apt-get install php5-sybase' 时,我得到 'sudo: apt-get: command not found'
    • 你按照这个步骤操作了吗From the directory of your PHP download, you'll move to the PDO_DBLIB extensions folder of PHP, build the pdo_dblib.so file, then copy it to the PHP extensions folder.
    【解决方案2】:

    在解决这个问题 3 天后,我找到了问题所在。

    因为我在我的机器 (7.2.9) 中安装了另一个 PHP 版本,所以不是安装在默认的 MacOS Mojave 文件夹 /usr/bin/php 中,而是安装在 /usr/local/php5-7.2.9-20180821-074958 中。因此,在下面的命令中,我需要更改:

    ./configure --with-php-config=/usr/bin/php-config --with-pdo-dblib=/usr/local/
    

    ./configure --with-php-config=/usr/local/php5-7.2.9-20180821-074958/bin/php-config --with-mssql=/usr/local/
    

    之后我可以正确编译扩展。

    【讨论】:

      猜你喜欢
      • 2017-05-28
      • 1970-01-01
      • 2012-07-21
      • 2018-05-27
      • 2016-05-16
      • 2012-05-30
      • 1970-01-01
      • 2016-08-05
      • 2017-11-07
      相关资源
      最近更新 更多