使用pecl安装redis

4

我正在尝试使用pecl安装redis,但最终出现了错误。

sudo pecl install redis 

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

我找到了一个和我相同的问题:
在OSX上使用PECL安装phpredis
回答:看起来你的php不在环境变量路径中,或者安装正在从某个默认位置选择php。
我如何确认我的php不在环境变量路径中,或者安装正在从某个默认位置选择php?此外,请让我知道是否您知道另一种方法来解决这个问题。
1个回答

0

我知道这是一个老问题,但当我尝试安装rdkafa时遇到了同样的错误。我想你是通过brew安装的php。 运行以下命令,然后再次尝试安装。

export PATH="$(brew --prefix php)/bin:$PATH"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接