安装 php oauth 包时:找不到 pcre.h,请尝试安装 libpcredevelopment/headers 包

问题描述 投票:0回答:1

我需要为第 3 方软件包安装 oauth (

pecl install oauth
)。我使用 Homebrew 安装了
pcre
pcre2
,但仍然 oauth 抱怨找不到
pcre.h
。 我使用的是 macOS Ventura 13.1 和 M1 Pro。想要的 php 版本是 7.3,但所有 php 版本都有相同的问题。
pcre.h
确实存在并且位于
/opt/homebrew/Cellar/pcre/8.45/include/pcre.h
下。

pcre 安装

[23-01-10 19:16] ~ brew reinstall pcre
==> Fetching pcre
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/manifests/8.45
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/blobs/sha256:542a6e5dcf5f1ac65929
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:54
######################################################################## 100.0%
==> Reinstalling pcre
==> Pouring pcre--8.45.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/pcre/8.45: 204 files, 4.6MB
==> Running `brew cleanup pcre`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
[23-01-10 19:16] ~ brew reinstall pcre2
==> Fetching pcre2
==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/manifests/10.42
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/blobs/sha256:8423a338c590ab1a6f2
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:84
######################################################################## 100.0%
==> Reinstalling pcre2
==> Pouring pcre2--10.42.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/pcre2/10.42: 230 files, 6.2MB
==> Running `brew cleanup pcre2`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

pecl oauth 安装输出

[23-01-10 19:16] ~ pecl install oauth
downloading oauth-2.0.7.tgz ...
Starting to download oauth-2.0.7.tgz (78,926 bytes)
..................done: 78,926 bytes
6 source files, building
running: phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731
configure.ac:7: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
aclocal.m4:2705: PHP_CONFIG_NICE is expanded from...
configure.ac:7: the top level
configure.ac:149: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:149: You should run autoupdate.
./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
aclocal.m4:6063: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6062: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:149: You should run autoupdate.
./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
aclocal.m4:3897: _LT_AC_LOCK is expanded from...
aclocal.m4:4520: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6063: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6062: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:149: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
aclocal.m4:3897: _LT_AC_LOCK is expanded from...
aclocal.m4:4520: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6063: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6062: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
aclocal.m4:4520: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6063: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6062: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
aclocal.m4:4520: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6063: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6062: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file \`$ofile' does not exist
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: output file \`$ofile' does not look like a libtool script
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: tag name \"$tagname\" already exists
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: The macro `AC_LANG_CPLUSPLUS' is obsolete.
configure.ac:149: You should run autoupdate.
./lib/autoconf/c.m4:262: AC_LANG_CPLUSPLUS is expanded from...
aclocal.m4:6145: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:6144: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
aclocal.m4:4520: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6145: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:6144: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:149: warning: back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe
aclocal.m4:4520: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6145: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:6144: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5253: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3406: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3388: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3375: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
building in /private/tmp/pear/temp/pear-build-tommyquissensDhzMOp/oauth-2.0.7
running: /private/tmp/pear/temp/oauth/configure --with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... arm-apple-darwin22.2.0
checking host system type... arm-apple-darwin22.2.0
checking target system type... arm-apple-darwin22.2.0
checking for PHP prefix... /opt/homebrew/Cellar/[email protected]/7.3.33_3
checking for PHP includes... -I/opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php -I/opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php/main -I/opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php/ext -I/opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php/ext/date/lib
checking for PHP extension directory... /opt/homebrew/Cellar/[email protected]/7.3.33_3/pecl/20180731
checking for PHP installed headers prefix... /opt/homebrew/Cellar/[email protected]/7.3.33_3/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 3.0 (ok)
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for oauth support... yes, shared
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for pcre.h... no
configure: error: Couldn't find pcre.h, try installing the libpcre development/headers package
ERROR: `/private/tmp/pear/temp/oauth/configure --with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config' failed
php macos homebrew php-extension pecl
1个回答
2
投票

在 M1 Pro MacBook Pro 上使用 macOS Monterey 12.6,以下是使用 brew 安装 PHP 8.1 的 oauth 扩展所需的步骤:

brew install pcre
brew install pcre2
sudo ln -s /opt/homebrew/include/pcre.h /usr/local/include/
sudo ln -s /opt/homebrew/include/pcre2.h /usr/local/include/
sudo pecl install oauth

(如果

/usr/local/include/
不存在,您可以继续创建它)

来源:https://stackoverflow.com/a/74051552/3360802

© www.soinside.com 2019 - 2024. All rights reserved.