I'm trying to install redis with pecl and finally got the error.
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
I found the same question as mine
Installing phpredis on osx with pecl
Answer: Looks like your php is not available in environment variable path or installation is picking php from some default location.
How I can confirm if my php is not available in environment variable path or installation is picking php from some default location? Plus, please let me know if you know another way to make it.
I know its old question but I had same error when tried to install rdkafa. I think you had php installed via brew. Run the following command then try installing again.
export PATH="$(brew --prefix php)/bin:$PATH"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.