Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on Mac M2 #494

Open
ozahorulia opened this issue Sep 4, 2023 · 2 comments
Open

Unable to install on Mac M2 #494

ozahorulia opened this issue Sep 4, 2023 · 2 comments

Comments

@ozahorulia
Copy link

Neither pecl nor compiling from source code works for me. Here is the full output from pecl (same with the source code during the make stage):

downloading apcu-5.1.22.tgz ...
Starting to download apcu-5.1.22.tgz (93,926 bytes)
.....................done: 93,926 bytes
44 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
Enable internal debugging in APCu [no] :
building in /private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22
running: /private/tmp/pear/temp/apcu/configure --with-php-config=/opt/homebrew/opt/[email protected]/bin/php-config --enable-apcu-debug=no
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 pkg-config... no
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 for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... aarch64-apple-darwin22.6.0
checking host system type... aarch64-apple-darwin22.6.0
checking target system type... aarch64-apple-darwin22.6.0
checking for PHP prefix... /opt/homebrew/Cellar/[email protected]/8.1.23
checking for PHP includes... -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib
checking for PHP extension directory... /opt/homebrew/Cellar/[email protected]/8.1.23/pecl/20210902
checking for PHP installed headers prefix... /opt/homebrew/Cellar/[email protected]/8.1.23/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable APCu support... yes, shared
checking if APCu should be allowed to use rwlocks... yes
checking if APCu should be built in debug mode... no
checking if APCu should clear on SIGUSR1... no
checking if APCu will use mmap (or shm)... yes
checking if APCu should utilize spinlocks before flocks... no
checking whether the target compiler supports builtin atomics... yes
checking for pthread rwlocks... yes
checking for pthread mutexes... yes
checking for clock_gettime... yes
checking for sigaction... yes
checking for union semun... yes
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 valgrind/memcheck.h... no
checking whether C compiler accepts -Wall... yes
checking whether C compiler accepts -Wextra... yes
checking whether C compiler accepts -Wno-unused-parameter... yes
checking for shm_open in -lrt... no
checking whether to include code coverage symbols... no
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 786432
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/apc.c -o apc.lo  -MMD -MF apc.dep -MT apc.lo
mkdir .libs
 cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/apc.c -MMD -MF apc.dep -MT apc.lo  -fno-common -DPIC -o .libs/apc.o
/bin/sh /private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/apc_lock.c -o apc_lock.lo  -MMD -MF apc_lock.dep -MT apc_lock.lo
 cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/apc_lock.c -MMD -MF apc_lock.dep -MT apc_lock.lo  -fno-common -DPIC -o .libs/apc_lock.o
/bin/sh /private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/apc_mutex.c -o apc_mutex.lo  -MMD -MF apc_mutex.dep -MT apc_mutex.lo
 cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/apc_mutex.c -MMD -MF apc_mutex.dep -MT apc_mutex.lo  -fno-common -DPIC -o .libs/apc_mutex.o
/bin/sh /private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/php_apc.c -o php_apc.lo  -MMD -MF php_apc.dep -MT php_apc.lo
 cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/include -I/private/tmp/pear/temp/pear-build-ozahoruliaABVeCp/apcu-5.1.22/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.23/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Wall -Wextra -Wno-unused-parameter -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/apcu/php_apc.c -MMD -MF php_apc.dep -MT php_apc.lo  -fno-common -DPIC -o .libs/php_apc.o
In file included from /private/tmp/pear/temp/apcu/php_apc.c:34:
/private/tmp/pear/temp/apcu/apc_iterator.h:59:2: error: unknown type name 'pcre_cache_entry'; did you mean 'apc_cache_entry_t'?
        pcre_cache_entry *pce;     /* regex filter on entry identifiers */
        ^~~~~~~~~~~~~~~~
        apc_cache_entry_t
/private/tmp/pear/temp/apcu/apc_cache.h:50:34: note: 'apc_cache_entry_t' declared here
typedef struct apc_cache_entry_t apc_cache_entry_t;
                                 ^
1 error generated.
make: *** [php_apc.lo] Error 1
ERROR: `make' failed

PHP version is 8.1.23

@cabbey
Copy link

cabbey commented Sep 13, 2023

I've run into this as well. The problem seems to be that the php pcre header, which apcu depends on, has a dependency on the pcre2 headers, but they aren't being configured into the include path for the compiler. The configure output includes this on my machine:

checking for PHP includes... -I/opt/homebrew/Cellar/[email protected]/8.1.22/include/php -I/opt/homebrew/Cellar/[email protected]/8.1.22/include/php/main -I/opt/homebrew/Cellar/[email protected]/8.1.22/include/php/TSRM -I/opt/homebrew/Cellar/[email protected]/8.1.22/include/php/Zend -I/opt/homebrew/Cellar/[email protected]/8.1.22/include/php/ext -I/opt/homebrew/Cellar/[email protected]/8.1.22/include/php/ext/date/lib

but there are files in those paths that depend on things outside of those paths. Nominally, either the php-config needs to include the headers for pcre2 in it's compiler includes, or the apcu configure process needs to go looking for them as a secondary dependency. I've confirmed this by adding -I/opt/homebrew/Cellar/pcre2/10.42/include to the list of includes in my php-config script and then successfully installing apcu with sudo pear install apcu.

@NomalSimple
Copy link

I've run into this as well and I've solved this problem and hope it can be helpful to you.

First

ls -l /opt/homebrew/Cellar/pcre2

If you don't have this directory, please execute:

brew install pcre2

Then

cd /opt/homebrew/Cellar/[email protected]/8.1.28/include/php/ext/pcre

And

ln -s /opt/homebrew/Cellar/pcre2/10.43/include/* ./

Last execute:

sudo pecl install apcu or sudo pear install apcu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants