我正在尝试添加 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 时遇到了这个问题。我已完成以下操作并已修复。
如果您还没有安装命令行工具,请安装。
xcode-select --install
安装头文件
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/