【问题标题】:Issue binding ZeroMQ to PHP In MacOS在 MacOS 中将 ZeroMQ 绑定到 PHP 问题
【发布时间】:2018-05-22 06:52:29
【问题描述】:

我正在尝试将 ZeroMQ 扩展的 PHP 功能添加到我的本地服务器。我已经成功安装了它,但是将它绑定到我系统的 PHP 是一个挑战。

我已经尝试了 PEAR/PECLGithub 构建方法,但是它们都归结为这个 CLI 错误:

In file included from /private/tmp/pear/install/zmq/zmq.c:31:
/private/tmp/pear/install/zmq/php_zmq.h:45:10: fatal error: 'php.h' file not found
#include "php.h"
         ^~~~~~~
1 error generated.
make: *** [zmq.lo] Error 1
ERROR: `make' failed

我在哪里可以生成并包含这个php.h 文件?

php-v 显示:PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )

phpize -v 显示:grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version:
Zend Module Api No:
Zend Extension Api No:

【问题讨论】:

  • php -vphpize -v 显示什么?你安装了php*-dev
  • 检查更新的问题@LawrenceCherone & 对于我的一生,我找不到安装php7-dev` 包的直接指导

标签: php error-handling command-line-interface zeromq failed-installation


【解决方案1】:

我在 MacOS 10.14.3 Mojave 上安装 zmq 时遇到了这个问题。我已经完成了以下操作,它已修复。

  1. 如果您还没有这样做,请安装命令行工具。

    xcode-select --install

  2. 安装头文件

    cd /Library/Developer/CommandLineTools/Packages/ 打开 macOS_SDK_headers_for_macOS_10.14.pkg

感谢@Steven Installing xdebug on MacOs Mojave - 'php.h' file not found

【讨论】:

    猜你喜欢
    • 2015-05-14
    • 1970-01-01
    • 2014-09-14
    • 2021-11-03
    • 2017-06-05
    • 1970-01-01
    • 2012-06-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多