php7的pecl安装扩展事出现编译问题

我想安装mongodb的php7扩展,指令是
/www/server/php/72/bin/pecl install mongodb
但是报出的错误是
configure: error: Cannot find php-config. Please use --with-php-config=PATH
然后我试着运行configure,指令是
./configure --with-php-config=/www/server/php/72/bin/php-config
结果报错
configure: WARNING: unrecognized options: --with-php-config
然后我又试着用pecl安装扩展,结果还是
configure: error: Cannot find php-config. Please use --with-php-config=PATH
哭…是不是编译就可以安装扩展了?
用的宝塔面板,我用宝塔装redis的扩展时就没事,现在我自己手动安装就不行…

阅读 4k
1 个回答

1、查看所有可配置项,php7已经没有--with-php-config选项了,默认生成在--bindir中

./configure -h

2、pecl 安装找不到php-config phpize等
将/www/server/php/72/bin/路径加入环境变量,或者单独将php、phpize、php-config等软链到/usr/bin或者/usr/local/bin

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题