2016-08-24 98 views
1

我通過我的一天來解決這個錯誤,我想是時候問一個問題了!Mac PHP7 Pecl Oauth:找不到pcre.h

所以當我嘗試因爲我是運行在Mac Os 10.11.6

與釀造 sudo pecl install oauth

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

我已經安裝PCRE安裝的Oauth PHP模塊我得到這個錯誤

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)

這裏還有就是定位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$ 

回答

0

所以我找到一個 「解決方案」,我已經編輯configure在src目錄裏面的OAuth -2.0.2

#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 

,我已經做./configuremakemake testmake install和我添加extension=oauth.sophp.ini

1

安裝PCRE:

brew install pcre

然後再次運行。