【问题标题】:Mac PHP7 Pecl Oauth : Couldn't find pcre.hMac PHP7 Pecl Oauth:找不到 pcre.h
【发布时间】:2016-12-31 17:52:18
【问题描述】:

我花了一天的时间来修复这个错误,我想是时候问一个问题了!

所以当我尝试安装 Oauth PHP 模块时出现此错误 sudo pecl install oauth

configure: error: Couldn't find pcre.h, try installing the libpcre development/headers package

我已经使用 Brew 安装了 pcre,因为我使用的是 Mac Os 10.11.6

Pcre 安装正确:

iLolo:oauth-2.0.2 do_f$ brew install pcre Warning: pcre-8.39 already installed

PHP 版本:

iLolo:oauth-2.0.2 do_f$ php -v PHP 7.0.8 (cli) (built: Jun 26 2016 12:30:44) ( NTS )

这里有locate pcre.h命令

iLolo:~ do_f$ locate pcre.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/php/ext/pcre/php_pcre.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/php/ext/pcre/php_pcre.h
/usr/local/Cellar/pcre/8.39/include/pcre.h
/usr/local/Cellar/pcre/8.39/share/doc/pcre/html/pcre.html
/usr/local/include/pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/php/ext/pcre/pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/php/ext/pcre/pcrelib/pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/php/ext/pcre/pcrelib/pcre.h.back
/usr/local/php5-7.0.8-20160626-123411/include/php/ext/pcre/php_pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/php/ext/pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/php/include/pcre.h
/usr/local/php5-7.0.8-20160626-123411/include/php/pcre.h
iLolo:~ do_f$ 

【问题讨论】:

    标签: php macos oauth pcre pecl


    【解决方案1】:

    所以我找到了一个“解决方案”,我在 src 目录 oauth-2.0.2 中编辑了 configure

    #ac_fn_c_check_header_mongrel "$LINENO" "pcre.h" "ac_cv_header_pcre_h"  "$ac_includes_default" 
    #if test "x$ac_cv_header_pcre_h" = xyes; then : 
    #else # as_fn_error $? "Couldn't find pcre.h, try installing the libpcre development/headers package" "$LINENO" 5 
    #fi
    

    然后我做了./configure make make test make install 并在php.ini 中添加extension=oauth.so

    【讨论】:

      【解决方案2】:

      安装pcre:

      brew install pcre

      然后再次运行。

      【讨论】:

        【解决方案3】:

        您需要安装 pcre-devel 软件包。打开配置脚本并注释掉检查不是您的答案。

        brew install pcre-devel         
        

        然后再试一次。

        【讨论】:

          猜你喜欢
          • 2023-03-06
          • 2016-03-14
          • 2012-04-22
          • 2012-12-10
          • 2010-12-10
          • 2015-07-10
          • 2016-09-20
          • 1970-01-01
          相关资源
          最近更新 更多