php - 在 MacOS 中将 ZeroMQ 绑定(bind)到 PHP

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

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

PEAR/PECL 我都试过了和 Github构建方法,但是它们都归结为这个 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:<br/> Zend Module Api No:<br/> Zend Extension Api No:

最佳答案

我在 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

关于php - 在 MacOS 中将 ZeroMQ 绑定(bind)到 PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47707361/

相关文章:

javascript - NodeJS - Events.js 无法读取未定义的每个属性

php - 引用 - 这个错误在 PHP 中意味着什么?

PHP 和 Postgres : catching errors?

javascript - 如何在命令行中在nodejs中提问

bash - 跟踪在 shell 脚本(例如 zsh)中执行的 shell 命令

php - 以小背景显示文本

php - (63)文件名太长 : access to/xyz failed referer:www. mydomain.com

php - 魔术方法(__get、__set)在扩展类中不起作用?

Php MySQL 最近 100 条记录最喜欢的查询

php - 如何使 PHP 文件只能通过 CLI 模式运行?