pecl 在 big sur m1 mac 上安装 yaml

时间:2021-04-02 15:14:33

标签: php yaml autoconf pecl apple-m1

所以这与 Cant install PHP yaml extension on Mac Big Sur 是相同的问题,但我正在尝试找到比粘贴硬编码值更好的解决方案。

我相信我应该能够使用

export LDFLAGS="-L/opt/homebrew/lib/" 
export CFLAGS="-I/opt/homebrew/include/"

但安装时出现同样的错误:

downloading yaml-2.2.1.tgz ...
Starting to download yaml-2.2.1.tgz (40,977 bytes)
............done: 40,977 bytes
8 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
configure.ac:7: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
aclocal.m4:2723: PHP_CONFIG_NICE is expanded from...
configure.ac:7: the top level
configure.ac:34: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:34: 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...
aclocal.m4:301: PHP_RUNPATH_SWITCH is expanded from...
configure.ac:34: 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:6027: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6026: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:3857: _LT_AC_LOCK is expanded from...
aclocal.m4:4484: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6027: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6026: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:3857: _LT_AC_LOCK is expanded from...
aclocal.m4:4484: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6027: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6026: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:4484: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6027: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6026: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:4484: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6027: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:6026: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:6109: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:6108: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:4484: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6109: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:6108: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: 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:4484: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
aclocal.m4:6109: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:6108: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5217: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3366: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:3348: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:3335: AC_PROG_LIBTOOL is expanded from...
configure.ac:149: the top level
configure.ac:199: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:199: You should run autoupdate.
./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:199: the top level
Please provide the prefix of libyaml installation [autodetect] :
building in /private/tmp/pear/temp/pear-build-adammarsheMny6w/yaml-2.2.1
running: /private/tmp/pear/temp/yaml/configure --with-php-config=/opt/homebrew/opt/valet-php@7.2/bin/php-config --with-yaml
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-darwin20.3.0
checking host system type... arm-apple-darwin20.3.0
checking target system type... arm-apple-darwin20.3.0
checking for PHP prefix... /opt/homebrew/Cellar/valet-php@7.2/7.2.34_4
checking for PHP includes... -I/opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php -I/opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php/main -I/opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php/TSRM -I/opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php/Zend -I/opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php/ext -I/opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php/ext/date/lib
checking for PHP extension directory... /opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/pecl/20170718
checking for PHP installed headers prefix... /opt/homebrew/Cellar/valet-php@7.2/7.2.34_4/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable LibYAML suppot... yes, shared
checking for yaml headers... not found
configure: error: Please install libyaml
ERROR: `/private/tmp/pear/temp/yaml/configure --with-php-config=/opt/homebrew/opt/valet-php@7.2/bin/php-config --with-yaml' failed

我也试过直接链接到 libyaml 在 /opt/homebrew 中包含 lib 目录,但它不起作用。

export LDFLAGS="-L/opt/homebrew/opt/libyaml/lib" 
export CFLAGS="-I/opt/homebrew/opt/libyaml/include/"

有人有什么想法吗?我也试过同时设置 pecl php_suffix 和 php_prefix 但出现以下错误:

  downloading yaml-2.2.1.tgz ...
  Starting to download yaml-2.2.1.tgz (40,977 bytes)
  ............done: 40,977 bytes
  8 source files, building
  running: phpizeLDFLAGS="-L/opt/homebrew/opt/libyaml/lib" CFLAGS="-I/opt/homebrew/opt/libyaml/include/"
  Please provide the prefix of libyaml installation [autodetect] : building in /private/tmp/pear/temp/pear-build-adammarshy2nRRr/yaml-2.2.1
  running: /private/tmp/pear/temp/yaml/configure --with-yaml
  sh: /private/tmp/pear/temp/yaml/configure: No such file or directory
  ERROR: `/private/tmp/pear/temp/yaml/configure --with-yaml' failed


install [--with-mariadb] [--brew-opt]

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我找到的最佳解决方案是执行以下操作:

echo $(brew --prefix yaml) | pecl install yaml
相关问题