[php-src] Issue #18885: fatal error: 'pcre2.h' file not found

From: Date: Fri, 20 Jun 2025 08:04:44 +0000
Subject: [php-src] Issue #18885: fatal error: 'pcre2.h' file not found
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-250286@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/18885 Author: staabm ### Description The following code: running pecl install apcu on my mac m4 pro runs into ``` /opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found 23 | #include "pcre2.h" | ^~~~~~~~~ 1 error generated. ``` full output: ``` ➜ php-rocket git:(master) pecl install apcu downloading apcu-5.1.24.tgz ... Starting to download apcu-5.1.24.tgz (90,866 bytes) .....................done: 90,866 bytes 44 source files, building running: phpize Configuring for: PHP Api Version: 20230831 Zend Module Api No: 20230831 Zend Extension Api No: 420230831 Enable internal debugging in APCu [no] : building in /private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24 running: /private/tmp/pear/temp/apcu/configure --with-php-config=/opt/homebrew/opt/php@8.3/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 egrep -e... (cached) /usr/bin/grep -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-darwin24.5.0 checking host system type... aarch64-apple-darwin24.5.0 checking target system type... aarch64-apple-darwin24.5.0 checking for PHP prefix... /opt/homebrew/Cellar/php@8.3/8.3.22 checking for PHP includes... -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib checking for PHP extension directory... /opt/homebrew/Cellar/php@8.3/8.3.22/pecl/20230831 checking for PHP installed headers prefix... /opt/homebrew/Cellar/php@8.3/8.3.22/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 should use mmap instead of shm... yes checking if APCu should utilize spinlocks before flocks... no checking whether to enable Valgrind-based memory checks... yes checking whether to include code coverage symbols... no 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 configure: Valgrind-based memory checks are disabled. checking whether the target compiler supports builtin atomics... yes checking for pthread rwlocks... yes checking for pthread mutexes... yes checking for sigaction... yes 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 library containing shm_open... none required 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... ld: warning: -single_module is obsolete 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... darwin24.5.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-m.staabtzoN3B/apcu-5.1.24/libtool --tag=CC --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/libtool --tag=CC --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/libtool --tag=CC --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/libtool --tag=CC --mode=compile cc -I. -I/private/tmp/pear/temp/apcu -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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-m.staabtzoN3B/apcu-5.1.24/include -I/private/tmp/pear/temp/pear-build-m.staabtzoN3B/apcu-5.1.24/main -I/private/tmp/pear/temp/apcu -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/main -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/TSRM -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/Zend -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext -I/opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -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: In file included from /private/tmp/pear/temp/apcu/apc_iterator.h:26: /opt/homebrew/Cellar/php@8.3/8.3.22/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found 23 | #include "pcre2.h" | ^~~~~~~~~ 1 error generated. make: *** [php_apc.lo] Error 1 ERROR: `make' failed ``` But I expected this output instead: successfull installation ---- sorry if I am missing important info for a repro.. I am not a php-src extension installer pro ;) ### PHP Version ```plain PHP 8.3.22 (cli) (built: Jun 3 2025 17:17:57) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.22, Copyright (c) Zend Technologies with Xdebug v3.4.0, Copyright (c) 2002-2024, by Derick Rethans ``` ### Operating System macos sequoia 15.5

« previous php.bugs (#250286) next »