简体   繁体   中英

pecl install yaml on big sur m1 mac

So this is the same issue as Cant install PHP yaml extension on Mac Big Sur but I'm trying to find a better solution then pasting hard coded values.

I believe I should be able to use

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

But when installing I get the same error:

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

I've also tried linking directly to the libyaml include lib directiories in /opt/homebrew but it doesn't work.

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

Anyone have any ideas? I've also tried setting both pecl php_suffix and php_prefix but getting the following error:

  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]

Any ideas?

Doesn't work for me (m1?).

echo $(brew --prefix libyaml) | pecl install yaml

Worked

The best solution I found was to do the folllowing:

echo $(brew --prefix yaml) | pecl install yaml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM