缺少 PHP 包括 (.h)

Missing PHP includes (.h)

我正在尝试为非默认 php 二进制位置安装 PHP 扩展 mongodb。我正在使用 PECL:

sudo pecl install mongodb

经过长时间的记录,我得到了这个

/tmp/pear/temp/mongodb/src/bson.c:29:17: fatal error: php.h: No such file or directory
 #include <php.h>
          ^
compilation terminated.
Makefile:338: recipe for target 'src/bson.lo' failed
make: *** [src/bson.lo] Error 1
ERROR: `make' failed

我怎样才能摆脱这个?

与此处相同的解决方案:尝试在 Ubuntu 上安装 OAuth 但出现错误

安装 PCRE 库(Perl 5 兼容正则表达式库):

# sudo apt-get update
# sudo apt-get install libpcre3 libpcre3-dev