public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/php] private-php86: Update to 8.4.0RC2 for https://fedoraproject.org/wiki/Changes/php84
@ 2026-11-27  7:33 Remi Collet
  0 siblings, 0 replies; only message in thread
From: Remi Collet @ 2026-11-27  7:33 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/php
            Branch : private-php86
            Commit : 36423f0fd2ac217f6ed5b0c19b26d2db409b1e08
            Author : Remi Collet <remi@fedoraproject.org>
            Date   : 2024-10-14T08:31:07+02:00
            Stats  : +1027/-1949 in 20 file(s)
            URL    : https://src.fedoraproject.org/rpms/php/c/36423f0fd2ac217f6ed5b0c19b26d2db409b1e08?branch=private-php86

            Log:
            Update to 8.4.0RC2 for https://fedoraproject.org/wiki/Changes/php84
bump ABI/API numbers
drop pspell and imap extensions

---
diff --git a/.gitignore b/.gitignore
index 34049db..c20f79b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,5 @@ TODO
 /php-8.3.12RC1.tar.xz.asc
 /php-8.3.12.tar.xz
 /php-8.3.12.tar.xz.asc
+/php-8.4.0RC2.tar.xz
+/php-8.4.0RC2.tar.xz.asc

diff --git a/php-7.2.0-includedir.patch b/php-7.2.0-includedir.patch
deleted file mode 100644
index 6d9a871..0000000
--- a/php-7.2.0-includedir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- php-7.2.0/configure.ac.includedir
-+++ php-7.2.0/configure.ac
-@@ -1230,7 +1230,7 @@
- EXPANDED_DATADIR=$datadir
- EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
- EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
--INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
-+INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR:${EXPANDED_DATADIR}/php
- 
- exec_prefix=$old_exec_prefix
- libdir=$old_libdir

diff --git a/php-7.4.0-httpd.patch b/php-7.4.0-httpd.patch
deleted file mode 100644
index 34f7c8a..0000000
--- a/php-7.4.0-httpd.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Disable MPM detection
-
-mod_php is build twice
-- as NTS without option
-- as ZTS using --enable-maintainer-zts
-
-diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
---- a/sapi/apache2handler/config.m4
-+++ b/sapi/apache2handler/config.m4
-@@ -105,17 +105,6 @@ if test "$PHP_APXS2" != "no"; then
-     ;;
-   esac
- 
--  if test "$APACHE_VERSION" -lt 2004001; then
--    APXS_MPM=`$APXS -q MPM_NAME`
--    if test "$APXS_MPM" != "prefork" && test "$APXS_MPM" != "peruser" && test "$APXS_MPM" != "itk"; then
--      PHP_BUILD_THREAD_SAFE
--    fi
--  else
--    APACHE_THREADED_MPM=`$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes'`
--    if test -n "$APACHE_THREADED_MPM"; then
--      PHP_BUILD_THREAD_SAFE
--    fi
--  fi
-   AC_MSG_RESULT(yes)
-   PHP_SUBST(APXS)
- else

diff --git a/php-7.4.0-ldap_r.patch b/php-7.4.0-ldap_r.patch
deleted file mode 100644
index 13566b4..0000000
--- a/php-7.4.0-ldap_r.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-
-Use -lldap_r by default.
-
-diff -up php-7.4.0RC2/ext/ldap/config.m4.ldap_r php-7.4.0RC2/ext/ldap/config.m4
---- php-7.4.0RC2/ext/ldap/config.m4.ldap_r	2019-09-17 10:21:24.769200812 +0200
-+++ php-7.4.0RC2/ext/ldap/config.m4	2019-09-17 10:21:30.658181771 +0200
-@@ -68,7 +68,11 @@ if test "$PHP_LDAP" != "no"; then
-   dnl -pc removal is a hack for clang
-   MACHINE_INCLUDES=$($CC -dumpmachine | $SED 's/-pc//')
- 
--  if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then
-+  if test -f $LDAP_LIBDIR/libldap_r.$SHLIB_SUFFIX_NAME; then
-+    PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-+    PHP_ADD_LIBRARY_WITH_PATH(ldap_r, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-+
-+  elif test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then
-     PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
-     PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
- 

diff --git a/php-7.4.0-phpize.patch b/php-7.4.0-phpize.patch
deleted file mode 100644
index 46aff56..0000000
--- a/php-7.4.0-phpize.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-diff -up ./scripts/phpize.in.headers ./scripts/phpize.in
---- ./scripts/phpize.in.headers	2019-07-23 10:05:11.000000000 +0200
-+++ ./scripts/phpize.in	2019-07-23 10:18:13.648098089 +0200
-@@ -166,6 +166,15 @@ phpize_autotools()
-   $PHP_AUTOHEADER || exit 1
- }
- 
-+phpize_check_headers()
-+{
-+  if test ! -f $includedir/main/php.h; then
-+    echo "Can't find PHP headers in $includedir"
-+    echo "The php-devel package is required for use of this command."
-+    exit 1
-+  fi
-+}
-+
- # Main script
- 
- case "$1" in
-@@ -184,12 +193,15 @@ case "$1" in
- 
-   # Version
-   --version|-v)
-+    phpize_check_headers
-     phpize_print_api_numbers
-     exit 0
-   ;;
- 
-   # Default
-   *)
-+     phpize_check_headers
-+
-      phpize_check_configm4 0
- 
-      phpize_check_build_files
-From c454f120857df6f771c5475bf1fcc99e683b87dc Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Thu, 7 Sep 2023 09:56:51 +0200
-Subject: [PATCH] also display PHP version in phpize
-
----
- scripts/phpize.in | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/scripts/phpize.in b/scripts/phpize.in
-index 7d9c1df14c8e..81605e06a590 100644
---- a/scripts/phpize.in
-+++ b/scripts/phpize.in
-@@ -59,6 +59,8 @@ phpize_check_configm4()
- phpize_get_api_numbers()
- {
-   # extracting API NOs:
-+  PHP_MINOR_VERSION=`grep '#define PHP_MINOR_VERSION' $includedir/main/php_version.h|$SED 's/#define PHP_MINOR_VERSION //'`
-+  PHP_MAJOR_VERSION=`grep '#define PHP_MAJOR_VERSION' $includedir/main/php_version.h|$SED 's/#define PHP_MAJOR_VERSION//'`
-   PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'`
-   ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'`
-   ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'`
-@@ -68,6 +70,7 @@ phpize_print_api_numbers()
- {
-   phpize_get_api_numbers
-   echo "Configuring for:"
-+  echo "PHP Version:            ${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}"
-   echo "PHP Api Version:        "$PHP_API_VERSION
-   echo "Zend Module Api No:     "$ZEND_MODULE_API_NO
-   echo "Zend Extension Api No:  "$ZEND_EXTENSION_API_NO

diff --git a/php-8.0.0-embed.patch b/php-8.0.0-embed.patch
deleted file mode 100644
index 27533ea..0000000
--- a/php-8.0.0-embed.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -up ./sapi/embed/config.m4.embed ./sapi/embed/config.m4
---- ./sapi/embed/config.m4.embed	2020-07-07 13:51:05.879764972 +0200
-+++ ./sapi/embed/config.m4	2020-07-07 13:52:50.128412148 +0200
-@@ -12,7 +12,8 @@ if test "$PHP_EMBED" != "no"; then
-     yes|shared)
-       LIBPHP_CFLAGS="-shared"
-       PHP_EMBED_TYPE=shared
--      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib"
-+      EXTRA_LDFLAGS="$EXTRA_LDFLAGS -release \$(PHP_MAJOR_VERSION).\$(PHP_MINOR_VERSION)"
-+      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(libdir); \$(LIBTOOL) --mode=install \$(INSTALL) -m 0755 \$(OVERALL_TARGET) \$(INSTALL_ROOT)\$(libdir)"
-       ;;
-     static)
-       LIBPHP_CFLAGS="-static"
-diff -up ./scripts/php-config.in.embed ./scripts/php-config.in
---- ./scripts/php-config.in.embed	2020-07-07 12:54:42.000000000 +0200
-+++ ./scripts/php-config.in	2020-07-07 13:51:05.880764968 +0200
-@@ -18,7 +18,7 @@ exe_extension="@EXEEXT@"
- php_cli_binary=NONE
- php_cgi_binary=NONE
- configure_options="@CONFIGURE_OPTIONS@"
--php_sapis="@PHP_INSTALLED_SAPIS@"
-+php_sapis="apache2handler litespeed fpm phpdbg @PHP_INSTALLED_SAPIS@"
- ini_dir="@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
- ini_path="@EXPANDED_PHP_CONFIG_FILE_PATH@"
- 

diff --git a/php-8.1.0-libdb.patch b/php-8.1.0-libdb.patch
deleted file mode 100644
index 7a2a097..0000000
--- a/php-8.1.0-libdb.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff -up ./ext/dba/config.m4.libdb ./ext/dba/config.m4
---- ./ext/dba/config.m4.libdb	2020-04-09 14:06:11.000000000 +0200
-+++ ./ext/dba/config.m4	2020-04-09 14:35:08.208605065 +0200
-@@ -375,61 +375,13 @@ if test "$PHP_DB4" != "no"; then
-   dbdp4="/usr/local/BerkeleyDB.4."
-   dbdp5="/usr/local/BerkeleyDB.5."
-   for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
--    if test -f "$i/db5/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/db5/db.h
--      break
--    elif test -f "$i/db4/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/db4/db.h
--      break
--    elif test -f "$i/include/db5.3/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db5.3/db.h
--      break
--    elif test -f "$i/include/db5.1/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db5.1/db.h
--      break
--    elif test -f "$i/include/db5.0/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db5.0/db.h
--      break
--    elif test -f "$i/include/db4.8/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.8/db.h
--      break
--    elif test -f "$i/include/db4.7/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.7/db.h
--      break
--    elif test -f "$i/include/db4.6/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.6/db.h
--      break
--    elif test -f "$i/include/db4.5/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.5/db.h
--      break
--    elif test -f "$i/include/db4/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4/db.h
--      break
--    elif test -f "$i/include/db/db4.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db/db4.h
--      break
--    elif test -f "$i/include/db4.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.h
--      break
--    elif test -f "$i/include/db.h"; then
-+    if test -f "$i/include/db.h"; then
-       THIS_PREFIX=$i
-       THIS_INCLUDE=$i/include/db.h
-       break
-     fi
-   done
--  PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
-+  PHP_DBA_DB_CHECK(4, db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
- fi
- PHP_DBA_STD_RESULT(db4,Berkeley DB4)
- 
-diff -up ./ext/dba/dba.c.libdb ./ext/dba/dba.c
---- ./ext/dba/dba.c.libdb	2020-04-09 14:06:11.000000000 +0200
-+++ ./ext/dba/dba.c	2020-04-09 14:36:30.593275190 +0200
-@@ -50,6 +50,10 @@
- #include "php_lmdb.h"
- #include "dba_arginfo.h"
- 
-+#ifdef DB4_INCLUDE_FILE
-+#include DB4_INCLUDE_FILE
-+#endif
-+
- PHP_MINIT_FUNCTION(dba);
- PHP_MSHUTDOWN_FUNCTION(dba);
- PHP_MINFO_FUNCTION(dba);
-@@ -452,6 +456,10 @@ PHP_MINFO_FUNCTION(dba)
- 
- 	php_info_print_table_start();
- 	php_info_print_table_row(2, "DBA support", "enabled");
-+#ifdef DB_VERSION_STRING
-+ 	php_info_print_table_row(2, "libdb header version", DB_VERSION_STRING);
-+ 	php_info_print_table_row(2, "libdb library version", db_version(NULL, NULL, NULL));
-+#endif
- 	if (handlers.s) {
- 		smart_str_0(&handlers);
- 		php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));

diff --git a/php-8.1.0-phpinfo.patch b/php-8.1.0-phpinfo.patch
deleted file mode 100644
index d19b2f4..0000000
--- a/php-8.1.0-phpinfo.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-
-Drop "Configure Command" from phpinfo as it doesn't
-provide any useful information.
-The available extensions are not related to this command.
-
-Replace full GCC name by gcc in php -v output
-
-
-diff -up ./ext/standard/info.c.phpinfo ./ext/standard/info.c
---- ./ext/standard/info.c.phpinfo	2020-07-21 10:49:31.000000000 +0200
-+++ ./ext/standard/info.c	2020-07-21 11:41:56.295633523 +0200
-@@ -805,9 +805,6 @@ PHPAPI ZEND_COLD void php_print_info(int
- #ifdef PHP_BUILD_ARCH
- 		php_info_print_table_row(2, "Architecture", PHP_BUILD_ARCH);
- #endif
--#ifdef CONFIGURE_COMMAND
--		php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND );
--#endif
- 
- 		if (sapi_module.pretty_name) {
- 			php_info_print_table_row(2, "Server API", sapi_module.pretty_name );
-diff -up ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo ./ext/standard/tests/general_functions/phpinfo.phpt
---- ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo	2020-07-21 10:49:31.000000000 +0200
-+++ ./ext/standard/tests/general_functions/phpinfo.phpt	2020-07-21 11:41:56.296633522 +0200
-@@ -17,7 +17,6 @@ PHP Version => %s
- 
- System => %s
- Build Date => %s%a
--Configure Command => %s
- Server API => Command Line Interface
- Virtual Directory Support => %s
- Configuration File (php.ini) Path => %s
-diff -up ./sapi/cli/php_cli.c.phpinfo ./sapi/cli/php_cli.c
---- ./sapi/cli/php_cli.c.phpinfo	2020-07-21 11:43:38.812475300 +0200
-+++ ./sapi/cli/php_cli.c	2020-07-21 11:43:45.783464540 +0200
-@@ -645,7 +645,7 @@ static int do_cli(int argc, char **argv)
- 					"NTS"
- #endif
- #ifdef PHP_BUILD_COMPILER
--					" " PHP_BUILD_COMPILER
-+					" gcc"
- #endif
- #ifdef PHP_BUILD_ARCH
- 					" " PHP_BUILD_ARCH

diff --git a/php-8.3.11-systzdata-v24.patch b/php-8.3.11-systzdata-v24.patch
deleted file mode 100644
index 90bdc78..0000000
--- a/php-8.3.11-systzdata-v24.patch
+++ /dev/null
@@ -1,746 +0,0 @@
-# License: MIT
-# http://opensource.org/licenses/MIT
-
-Add support for use of the system timezone database, rather
-than embedding a copy.  Discussed upstream but was not desired.
-
-History:
-f24: add internal UTC if tzdata is missing
-r23: fix possible buffer overflow
-r22: retrieve tzdata version from /usr/share/zoneinfo/tzdata.zi
-r21: adapt for timelib 2021.03 (in 8.1.0)
-r20: adapt for timelib 2020.03 (in 8.0.10RC1)
-r19: adapt for timelib 2020.02 (in 8.0.0beta2)
-r18: adapt for autotool change in 7.3.3RC1
-r17: adapt for timelib 2018.01 (in 7.3.2RC1)
-r16: adapt for timelib 2017.06 (in 7.2.3RC1)
-r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1)
-r14: improve check for valid tz file
-r13: adapt for upstream changes to use PHP allocator
-r12: adapt for upstream changes for new zic
-r11: use canonical names to avoid more case sensitivity issues
-     round lat/long from zone.tab towards zero per builtin db
-r10: make timezone case insensitive
-r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
-r8: fix compile error without --with-system-tzdata configured
-r7: improve check for valid timezone id to exclude directories
-r6: fix fd leak in r5, fix country code/BC flag use in
-    timezone_identifiers_list() using system db,
-    fix use of PECL timezonedb to override system db,
-r5: reverts addition of "System/Localtime" fake tzname.
-    updated for 5.3.0, parses zone.tab to pick up mapping between
-    timezone name, country code and long/lat coords
-r4: added "System/Localtime" tzname which uses /etc/localtime
-r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
-r2: add filesystem trawl to set up name alias index
-r1: initial revision
-
-
-diff --git a/ext/date/config0.m4 b/ext/date/config0.m4
-index 6b803bf33e..53c3cdb3f4 100644
---- a/ext/date/config0.m4
-+++ b/ext/date/config0.m4
-@@ -4,6 +4,19 @@
- dnl Check for strtoll, atoll
- AC_CHECK_FUNCS(strtoll atoll)
- 
-+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
-+[  --with-system-tzdata[=DIR]      to specify use of system timezone data],
-+no, no)
-+
-+if test "$PHP_SYSTEM_TZDATA" != "no"; then
-+   AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
-+
-+   if test "$PHP_SYSTEM_TZDATA" != "yes"; then
-+      AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
-+                         [Define for location of system timezone data])
-+   fi
-+fi
-+
- AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],
-   [PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -Wno-implicit-fallthrough"],,
-   [-Werror])
-diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
-index c7f93580d7..ec196a98b6 100644
---- a/ext/date/lib/parse_tz.c
-+++ b/ext/date/lib/parse_tz.c
-@@ -26,9 +26,33 @@
- #include "timelib.h"
- #include "timelib_private.h"
- 
-+#ifdef HAVE_SYSTEM_TZDATA
-+#include <sys/mman.h>
-+#include <sys/stat.h>
-+#include <limits.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include "php_scandir.h"
-+
-+static const unsigned char internal_utc[] = {
-+        0x54, 0x5a, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x54, 0x5a, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
-+        0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x0a, 0x55, 0x54, 0x43,
-+        0x30, 0x0a
-+};
-+
-+#else
- #define TIMELIB_SUPPORTS_V2DATA
- #define TIMELIB_SUPPORT_SLIM_FILE
- #include "timezonedb.h"
-+#endif
-+
-+#include <ctype.h>
- 
- #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
- # if defined(__LITTLE_ENDIAN__)
-@@ -95,6 +119,11 @@ static int read_php_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
- {
- 	uint32_t version;
- 
-+	if (memcmp(*tzf, "TZif", 4) == 0) {
-+		*tzf += 20;
-+		return 0;
-+	}
-+
- 	/* read ID */
- 	version = (*tzf)[3] - '0';
- 	*tzf += 4;
-@@ -577,7 +606,475 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
- 	}
- }
- 
--static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb)
-+#ifdef HAVE_SYSTEM_TZDATA
-+
-+#ifdef HAVE_SYSTEM_TZDATA_PREFIX
-+#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
-+#else
-+#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
-+#endif
-+
-+/* System timezone database pointer. */
-+static const timelib_tzdb *timezonedb_system;
-+
-+/* Hash table entry for the cache of the zone.tab mapping table. */
-+struct location_info {
-+        char code[2];
-+        double latitude, longitude;
-+        char name[64];
-+        char *comment;
-+        struct location_info *next;
-+};
-+
-+/* Cache of zone.tab. */
-+static struct location_info **system_location_table;
-+
-+/* Size of the zone.tab hash table; a random-ish prime big enough to
-+ * prevent too many collisions. */
-+#define LOCINFO_HASH_SIZE (1021)
-+
-+/* Compute a case insensitive hash of str */
-+static uint32_t tz_hash(const char *str)
-+{
-+    const unsigned char *p = (const unsigned char *)str;
-+    uint32_t hash = 5381;
-+    int c;
-+
-+    while ((c = tolower(*p++)) != '\0') {
-+        hash = (hash << 5) ^ hash ^ c;
-+    }
-+
-+    return hash % LOCINFO_HASH_SIZE;
-+}
-+
-+/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
-+ * parsed string on success, or NULL on parse error.  On success,
-+ * writes the parsed number to *result. */
-+static char *parse_iso6709(char *p, double *result)
-+{
-+    double v, sign;
-+    char *pend;
-+    size_t len;
-+
-+    if (*p == '+')
-+        sign = 1.0;
-+    else if (*p == '-')
-+        sign = -1.0;
-+    else
-+        return NULL;
-+
-+    p++;
-+    for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
-+        ;;
-+
-+    /* Annoying encoding used by zone.tab has no decimal point, so use
-+     * the length to determine the format:
-+     * 
-+     * 4 = DDMM
-+     * 5 = DDDMM
-+     * 6 = DDMMSS
-+     * 7 = DDDMMSS
-+     */
-+    len = pend - p;
-+    if (len < 4 || len > 7) {
-+        return NULL;
-+    }
-+
-+    /* p => [D]DD */
-+    v = (p[0] - '0') * 10.0 + (p[1] - '0');
-+    p += 2;
-+    if (len == 5 || len == 7)
-+        v = v * 10.0 + (*p++ - '0');
-+    /* p => MM[SS] */
-+    v += (10.0 * (p[0] - '0')
-+          + p[1] - '0') / 60.0;
-+    p += 2;
-+    /* p => [SS] */
-+    if (len > 5) {
-+        v += (10.0 * (p[0] - '0')
-+              + p[1] - '0') / 3600.0;
-+        p += 2;
-+    }
-+
-+    /* Round to five decimal place, not because it's a good idea,
-+     * but, because the builtin data uses rounded data, so, match
-+     * that. */
-+    *result = trunc(v * sign * 100000.0) / 100000.0;
-+
-+    return p;
-+}
-+
-+/* This function parses the zone.tab file to build up the mapping of
-+ * timezone to country code and geographic location, and returns a
-+ * hash table.  The hash table is indexed by the function:
-+ *
-+ *   tz_hash(timezone-name)
-+ */
-+static struct location_info **create_location_table(void)
-+{
-+    struct location_info **li, *i;
-+    char zone_tab[PATH_MAX];
-+    char line[512];
-+    FILE *fp;
-+
-+    strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
-+
-+    fp = fopen(zone_tab, "r");
-+    if (!fp) {
-+        return NULL;
-+    }
-+
-+    li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
-+
-+    while (fgets(line, sizeof line, fp)) {
-+        char *p = line, *code, *name, *comment;
-+        uint32_t hash;
-+        double latitude, longitude;
-+
-+        while (isspace(*p))
-+            p++;
-+
-+        if (*p == '#' || *p == '\0' || *p == '\n')
-+            continue;
-+        
-+        if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
-+            continue;
-+        
-+        /* code => AA */
-+        code = p;
-+        p[2] = 0;
-+        p += 3;
-+
-+        /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
-+        p = parse_iso6709(p, &latitude);
-+        if (!p) {
-+            continue;
-+        }
-+        p = parse_iso6709(p, &longitude);
-+        if (!p) {
-+            continue;
-+        }
-+
-+        if (!p || *p != '\t') {
-+            continue;
-+        }
-+
-+        /* name = string */
-+        name = ++p;
-+        while (*p != '\t' && *p && *p != '\n')
-+            p++;
-+
-+        *p++ = '\0';
-+
-+        /* comment = string */
-+        comment = p;
-+        while (*p != '\t' && *p && *p != '\n')
-+            p++;
-+
-+        if (*p == '\n' || *p == '\t')
-+            *p = '\0';
-+        
-+        hash = tz_hash(name);
-+        i = malloc(sizeof *i);
-+        memcpy(i->code, code, 2);
-+        strncpy(i->name, name, sizeof i->name);
-+        i->comment = strdup(comment);
-+        i->longitude = longitude;
-+        i->latitude = latitude;
-+        i->next = li[hash];
-+        li[hash] = i;
-+        /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
-+    }
-+
-+    fclose(fp);
-+
-+    return li;
-+}
-+
-+/* Return location info from hash table, using given timezone name.
-+ * Returns NULL if the name could not be found. */
-+const struct location_info *find_zone_info(struct location_info **li, 
-+                                           const char *name)
-+{
-+    uint32_t hash = tz_hash(name);
-+    const struct location_info *l;
-+
-+    if (!li) {
-+        return NULL;
-+    }
-+
-+    for (l = li[hash]; l; l = l->next) {
-+        if (timelib_strcasecmp(l->name, name) == 0)
-+            return l;
-+    }
-+
-+    return NULL;
-+}    
-+
-+/* Filter out some non-tzdata files and the posix/right databases, if
-+ * present. */
-+static int index_filter(const struct dirent *ent)
-+{
-+	return strcmp(ent->d_name, ".") != 0
-+		&& strcmp(ent->d_name, "..") != 0
-+		&& strcmp(ent->d_name, "posix") != 0
-+		&& strcmp(ent->d_name, "posixrules") != 0
-+		&& strcmp(ent->d_name, "right") != 0
-+		&& strstr(ent->d_name, ".list") == NULL
-+		&& strstr(ent->d_name, ".tab") == NULL;
-+}
-+
-+static int sysdbcmp(const void *first, const void *second)
-+{
-+        const timelib_tzdb_index_entry *alpha = first, *beta = second;
-+
-+        return timelib_strcasecmp(alpha->id, beta->id);
-+}
-+
-+/* Retrieve tzdata version. */
-+static void retrieve_zone_version(timelib_tzdb *db)
-+{
-+    static char buf[30];
-+    char path[PATH_MAX];
-+    FILE *fp;
-+
-+    strncpy(path, ZONEINFO_PREFIX "/tzdata.zi", sizeof(path));
-+
-+    fp = fopen(path, "r");
-+    if (fp) {
-+		if (fgets(buf, sizeof(buf), fp)) {
-+			if (!memcmp(buf, "# version ", 10) &&
-+				isdigit(buf[10]) &&
-+				isdigit(buf[11]) &&
-+				isdigit(buf[12]) &&
-+				isdigit(buf[13]) &&
-+				islower(buf[14])) {
-+				if (buf[14] >= 't') {        /* 2022t = 2022.20 */
-+					buf[17] = 0;
-+					buf[16] = buf[14] - 't' + '0';
-+					buf[15] = '2';
-+				} else if (buf[14] >= 'j') { /* 2022j = 2022.10 */
-+					buf[17] = 0;
-+					buf[16] = buf[14] - 'j' + '0';
-+					buf[15] = '1';
-+				} else {                     /* 2022a = 2022.1  */
-+					buf[16] = 0;
-+					buf[15] = buf[14] - 'a' + '1';
-+				}
-+				buf[14] = '.';
-+				db->version = buf+10;
-+			}
-+		}
-+		fclose(fp);
-+    }
-+}
-+
-+
-+/* Create the zone identifier index by trawling the filesystem. */
-+static void create_zone_index(timelib_tzdb *db)
-+{
-+	size_t dirstack_size,  dirstack_top;
-+	size_t index_size, index_next;
-+	timelib_tzdb_index_entry *db_index;
-+	char **dirstack;
-+
-+	/* LIFO stack to hold directory entries to scan; each slot is a
-+	 * directory name relative to the zoneinfo prefix. */
-+	dirstack_size = 32;
-+	dirstack = malloc(dirstack_size * sizeof *dirstack);
-+	dirstack_top = 1;
-+	dirstack[0] = strdup("");
-+	
-+	/* Index array. */
-+	index_size = 64;
-+	db_index = malloc(index_size * sizeof *db_index);
-+	index_next = 0;
-+
-+	do {
-+		struct dirent **ents;
-+		char name[PATH_MAX], *top;
-+		int count;
-+
-+		/* Pop the top stack entry, and iterate through its contents. */
-+		top = dirstack[--dirstack_top];
-+		snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
-+
-+		count = php_scandir(name, &ents, index_filter, php_alphasort);
-+
-+		while (count > 0) {
-+			struct stat st;
-+			const char *leaf = ents[count - 1]->d_name;
-+
-+			snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s", 
-+				 top, leaf);
-+			
-+			if (strlen(name) && stat(name, &st) == 0) {
-+				/* Name, relative to the zoneinfo prefix. */
-+				const char *root = top;
-+
-+				if (root[0] == '/') root++;
-+
-+				snprintf(name, sizeof name, "%s%s%s", root, 
-+					 *root ? "/": "", leaf);
-+
-+				if (S_ISDIR(st.st_mode)) {
-+					if (dirstack_top == dirstack_size) {
-+						dirstack_size *= 2;
-+						dirstack = realloc(dirstack, 
-+								   dirstack_size * sizeof *dirstack);
-+					}
-+					dirstack[dirstack_top++] = strdup(name);
-+				}
-+				else {
-+					if (index_next == index_size) {
-+						index_size *= 2;
-+						db_index = realloc(db_index,
-+								   index_size * sizeof *db_index);
-+					}
-+
-+					db_index[index_next++].id = strdup(name);
-+				}
-+			}
-+
-+			free(ents[--count]);
-+		}
-+		
-+		if (count != -1) free(ents);
-+		free(top);
-+	} while (dirstack_top);
-+
-+        qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
-+
-+	if (!index_next) {
-+		db_index[index_next++].id = strdup("UTC");
-+	}
-+	db->index = db_index;
-+	db->index_size = index_next;
-+
-+	free(dirstack);
-+}
-+
-+#define FAKE_HEADER "1234\0??\1??"
-+#define FAKE_UTC_POS (7 - 4)
-+
-+/* Create a fake data segment for database 'sysdb'. */
-+static void fake_data_segment(timelib_tzdb *sysdb,
-+                              struct location_info **info)
-+{
-+        size_t n;
-+        char *data, *p;
-+        
-+        data = malloc(3 * sysdb->index_size + sizeof(FAKE_HEADER) - 1);
-+
-+        p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
-+
-+        for (n = 0; n < sysdb->index_size; n++) {
-+                const struct location_info *li;
-+                timelib_tzdb_index_entry *ent;
-+
-+                ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
-+
-+                /* Lookup the timezone name in the hash table. */
-+                if (strcmp(ent->id, "UTC") == 0) {
-+                        ent->pos = FAKE_UTC_POS;
-+                        continue;
-+                }
-+
-+                li = find_zone_info(info, ent->id);
-+                if (li) {
-+                        /* If found, append the BC byte and the
-+                         * country code; set the position for this
-+                         * section of timezone data.  */
-+                        ent->pos = (p - data) - 4;
-+                        *p++ = '\1';
-+                        *p++ = li->code[0];
-+                        *p++ = li->code[1];
-+                }
-+                else {
-+                        /* If not found, the timezone data can
-+                         * point at the header. */
-+                        ent->pos = 0;
-+                }
-+        }
-+        
-+        sysdb->data = (unsigned char *)data;
-+}
-+
-+/* Returns true if the passed-in stat structure describes a
-+ * probably-valid timezone file. */
-+static int is_valid_tzfile(const struct stat *st, int fd)
-+{
-+	if (fd) {
-+		char buf[20];
-+		if (read(fd, buf, 20)!=20) {
-+			return 0;
-+		}
-+		lseek(fd, SEEK_SET, 0);
-+		if (memcmp(buf, "TZif", 4)) {
-+			return 0;
-+		}
-+	}
-+	return S_ISREG(st->st_mode) && st->st_size > 20;
-+}
-+
-+/* To allow timezone names to be used case-insensitively, find the
-+ * canonical name for this timezone, if possible. */
-+static const char *canonical_tzname(const char *timezone)
-+{
-+    if (timezonedb_system) {
-+        timelib_tzdb_index_entry *ent, lookup;
-+
-+        lookup.id = (char *)timezone;
-+
-+        ent = bsearch(&lookup, timezonedb_system->index,
-+                      timezonedb_system->index_size, sizeof lookup,
-+                      sysdbcmp);
-+        if (ent) {
-+            return ent->id;
-+        }
-+    }
-+
-+    return timezone;
-+}
-+
-+/* Return the mmap()ed tzfile if found, else NULL.  On success, the
-+ * length of the mapped data is placed in *length. */
-+static char *map_tzfile(const char *timezone, size_t *length)
-+{
-+	char fname[PATH_MAX];
-+	struct stat st;
-+	char *p;
-+	int fd;
-+	
-+	if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
-+		return NULL;
-+	}
-+
-+	snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
-+
-+	fd = open(fname, O_RDONLY);
-+	if (fd == -1) {
-+		if (strcmp(timezone, "UTC")) {
-+			return NULL;
-+		} else {
-+			*length = sizeof(internal_utc);
-+			return internal_utc;
-+		}
-+	} else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) {
-+		close(fd);
-+		return NULL;
-+	}
-+
-+	*length = st.st_size;
-+	p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
-+	close(fd);
-+	
-+	return p != MAP_FAILED ? p : NULL;
-+}
-+
-+#endif
-+
-+static int inmem_seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb)
- {
- 	int left = 0, right = tzdb->index_size - 1;
- 
-@@ -603,9 +1100,49 @@ static int seek_to_tz_position(const unsigned char **tzf, const char *timezone,
- 	return 0;
- }
- 
-+static int seek_to_tz_position(const unsigned char **tzf, const char *timezone,
-+			       char **map, size_t *maplen,
-+			       const timelib_tzdb *tzdb)
-+{
-+#ifdef HAVE_SYSTEM_TZDATA
-+	if (tzdb == timezonedb_system) {
-+		char *orig;
-+
-+		orig = map_tzfile(timezone, maplen);
-+		if (orig == NULL) {
-+			return 0;
-+		}
-+
-+		(*tzf) = (unsigned char *)orig;
-+		*map = orig;
-+        return 1;
-+	}
-+	else
-+#endif
-+	{
-+		return inmem_seek_to_tz_position(tzf, timezone, tzdb);
-+	}
-+}
-+
- const timelib_tzdb *timelib_builtin_db(void)
- {
-+#ifdef HAVE_SYSTEM_TZDATA
-+	if (timezonedb_system == NULL) {
-+		timelib_tzdb *tmp = malloc(sizeof *tmp);
-+
-+		tmp->version = "0";
-+		tmp->data = NULL;
-+		create_zone_index(tmp);
-+		retrieve_zone_version(tmp);
-+		system_location_table = create_location_table();
-+		fake_data_segment(tmp, system_location_table);
-+		timezonedb_system = tmp;
-+	}
-+
-+	return timezonedb_system;
-+#else
- 	return &timezonedb_builtin;
-+#endif
- }
- 
- const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
-@@ -617,7 +1154,32 @@ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_
- int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb)
- {
- 	const unsigned char *tzf;
--	return (seek_to_tz_position(&tzf, timezone, tzdb));
-+
-+#ifdef HAVE_SYSTEM_TZDATA
-+	if (tzdb == timezonedb_system) {
-+		char fname[PATH_MAX];
-+		struct stat st;
-+
-+		if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
-+			return 0;
-+		}
-+		if (!strcmp(timezone, "UTC")) {
-+			return 1;
-+		}
-+		if (system_location_table) {
-+			if (find_zone_info(system_location_table, timezone) != NULL) {
-+				/* found in cache */
-+				return 1;
-+			}
-+		}
-+
-+		snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
-+
-+		return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0);
-+	}
-+#endif
-+
-+	return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
- }
- 
- static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -662,6 +1224,8 @@ static timelib_tzinfo* timelib_tzinfo_ctor(const char *name)
- timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code)
- {
- 	const unsigned char *tzf;
-+	char *memmap = NULL;
-+	size_t maplen;
- 	timelib_tzinfo *tmp;
- 	int version;
- 	int transitions_result, types_result;
-@@ -669,7 +1233,7 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
- 
- 	*error_code = TIMELIB_ERROR_NO_ERROR;
- 
--	if (seek_to_tz_position(&tzf, timezone, tzdb)) {
-+	if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
- 		tmp = timelib_tzinfo_ctor(timezone);
- 
- 		version = read_preamble(&tzf, tmp, &type);
-@@ -712,11 +1276,38 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
- 			return NULL;
- 		}
- 
-+#ifdef HAVE_SYSTEM_TZDATA
-+		if (memmap) {
-+			const struct location_info *li;
-+
-+			/* TZif-style - grok the location info from the system database,
-+			 * if possible. */
-+
-+			if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
-+				tmp->location.comments = timelib_strdup(li->comment);
-+				strncpy(tmp->location.country_code, li->code, 2);
-+				tmp->location.longitude = li->longitude;
-+				tmp->location.latitude = li->latitude;
-+				tmp->bc = 1;
-+			}
-+			else {
-+				set_default_location_and_comments(&tzf, tmp);
-+			}
-+
-+			/* Now done with the mmap segment - discard it. */
-+			if (memmap != internal_utc) {
-+				munmap(memmap, maplen);
-+			}
-+		} else {
-+#endif
- 		if (type == TIMELIB_TZINFO_PHP) {
- 			read_location(&tzf, tmp);
- 		} else {
- 			set_default_location_and_comments(&tzf, tmp);
- 		}
-+#ifdef HAVE_SYSTEM_TZDATA
-+		}
-+#endif
- 	} else {
- 		*error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE;
- 		tmp = NULL;
-diff --git a/ext/date/php_date.c b/ext/date/php_date.c
-index 48c82bf7ec..443299c089 100644
---- a/ext/date/php_date.c
-+++ b/ext/date/php_date.c
-@@ -490,7 +490,11 @@ PHP_MINFO_FUNCTION(date)
- 	php_info_print_table_row(2, "date/time support", "enabled");
- 	php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION);
- 	php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
-+#ifdef HAVE_SYSTEM_TZDATA
-+	php_info_print_table_row(2, "Timezone Database", "system");
-+#else
- 	php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
-+#endif
- 	php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
- 	php_info_print_table_end();
- 

diff --git a/php-8.3.7-argon2.patch b/php-8.3.7-argon2.patch
deleted file mode 100644
index d6d2766..0000000
--- a/php-8.3.7-argon2.patch
+++ /dev/null
@@ -1,842 +0,0 @@
-From c6c39b2b1cb1ff9916a8db606b19fc4282feacd2 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Wed, 17 Apr 2024 15:58:49 +0200
-Subject: [PATCH] Implement PASSWORD_ARGON2 from OpenSSL 3.2 Backported from
- 8.4 to 8.3
-
----
- ext/openssl/config0.m4                        |   2 +-
- ext/openssl/openssl.c                         |  24 +
- ext/openssl/openssl_pwhash.c                  | 412 ++++++++++++++++++
- ext/openssl/openssl_pwhash.stub.php           |  38 ++
- ext/openssl/openssl_pwhash_arginfo.h          | Bin 0 -> 2571 bytes
- ext/openssl/php_openssl.h                     |  31 +-
- ext/openssl/tests/openssl_password.phpt       |  42 ++
- .../tests/openssl_password_compat.phpt        |  52 +++
- .../tests/openssl_password_compat2.phpt       |  52 +++
- 9 files changed, 651 insertions(+), 2 deletions(-)
- create mode 100644 ext/openssl/openssl_pwhash.c
- create mode 100644 ext/openssl/openssl_pwhash.stub.php
- create mode 100644 ext/openssl/openssl_pwhash_arginfo.h
- create mode 100644 ext/openssl/tests/openssl_password.phpt
- create mode 100644 ext/openssl/tests/openssl_password_compat.phpt
- create mode 100644 ext/openssl/tests/openssl_password_compat2.phpt
-
-diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4
-index ffd4e0751c..aae3812752 100644
---- a/ext/openssl/config0.m4
-+++ b/ext/openssl/config0.m4
-@@ -18,7 +18,7 @@ PHP_ARG_WITH([system-ciphers],
-   [no])
- 
- if test "$PHP_OPENSSL" != "no"; then
--  PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared)
-+  PHP_NEW_EXTENSION(openssl, openssl.c openssl_pwhash.c xp_ssl.c, $ext_shared)
-   PHP_SUBST(OPENSSL_SHARED_LIBADD)
- 
-   if test "$PHP_KERBEROS" != "no"; then
-diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
-index 6f85e9852f..1f164a60b6 100644
---- a/ext/openssl/openssl.c
-+++ b/ext/openssl/openssl.c
-@@ -263,9 +263,21 @@ static void php_openssl_pkey_free_obj(zend_object *object)
- 	zend_object_std_dtor(&key_object->std);
- }
- 
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+static const zend_module_dep openssl_deps[] = {
-+	ZEND_MOD_REQUIRED("standard")
-+	ZEND_MOD_END
-+};
-+#endif
-+
- /* {{{ openssl_module_entry */
- zend_module_entry openssl_module_entry = {
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	STANDARD_MODULE_HEADER_EX, NULL,
-+	openssl_deps,
-+#else
- 	STANDARD_MODULE_HEADER,
-+#endif
- 	"openssl",
- 	ext_functions,
- 	PHP_MINIT(openssl),
-@@ -1321,6 +1333,12 @@ PHP_MINIT_FUNCTION(openssl)
- 
- 	REGISTER_INI_ENTRIES();
- 
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	if (FAILURE == PHP_MINIT(openssl_pwhash)(INIT_FUNC_ARGS_PASSTHRU)) {
-+		return FAILURE;
-+	}
-+#endif
-+
- 	return SUCCESS;
- }
- /* }}} */
-@@ -1395,6 +1413,12 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
- 	php_stream_xport_unregister("tlsv1.3");
- #endif
- 
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	if (FAILURE == PHP_MSHUTDOWN(openssl_pwhash)(SHUTDOWN_FUNC_ARGS_PASSTHRU)) {
-+		return FAILURE;
-+	}
-+#endif
-+
- 	/* reinstate the default tcp handler */
- 	php_stream_xport_register("tcp", php_stream_generic_socket_factory);
- 
-diff --git a/ext/openssl/openssl_pwhash.c b/ext/openssl/openssl_pwhash.c
-new file mode 100644
-index 0000000000..56ab62ff83
---- /dev/null
-+++ b/ext/openssl/openssl_pwhash.c
-@@ -0,0 +1,412 @@
-+/*
-+   +----------------------------------------------------------------------+
-+   | Copyright (c) The PHP Group                                          |
-+   +----------------------------------------------------------------------+
-+   | This source file is subject to version 3.01 of the PHP license,      |
-+   | that is bundled with this package in the file LICENSE, and is        |
-+   | available through the world-wide-web at the following url:           |
-+   | https://www.php.net/license/3_01.txt                                 |
-+   | If you did not receive a copy of the PHP license and are unable to   |
-+   | obtain it through the world-wide-web, please send a note to          |
-+   | license@php.net so we can mail you a copy immediately.               |
-+   +----------------------------------------------------------------------+
-+   | Authors: Remi Collet <remi@php.net>                                  |
-+   +----------------------------------------------------------------------+
-+*/
-+
-+#ifdef HAVE_CONFIG_H
-+# include "config.h"
-+#endif
-+
-+#include "php.h"
-+#include "ext/standard/php_password.h"
-+#include "php_openssl.h"
-+
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+#include "Zend/zend_attributes.h"
-+#include "openssl_pwhash_arginfo.h"
-+#include <ext/standard/base64.h>
-+#include <openssl/params.h>
-+#include <openssl/core_names.h>
-+#include <openssl/kdf.h>
-+#include <openssl/thread.h>
-+#include <openssl/rand.h>
-+
-+#define PHP_OPENSSL_MEMLIMIT_MIN  8u
-+#define PHP_OPENSSL_MEMLIMIT_MAX  UINT32_MAX
-+#define PHP_OPENSSL_ITERLIMIT_MIN 1u
-+#define PHP_OPENSSL_ITERLIMIT_MAX UINT32_MAX
-+#define PHP_OPENSSL_THREADS_MIN   1u
-+#define PHP_OPENSSL_THREADS_MAX   UINT32_MAX
-+
-+#define PHP_OPENSSL_ARGON_VERSION 0x13
-+
-+#define PHP_OPENSSL_SALT_SIZE     16
-+#define PHP_OPENSSL_HASH_SIZE     32
-+#define PHP_OPENSSL_DIGEST_SIZE   128
-+
-+static inline zend_result get_options(zend_array *options, uint32_t *memlimit, uint32_t *iterlimit, uint32_t *threads)
-+{
-+	zval *opt;
-+
-+	*iterlimit = PHP_OPENSSL_PWHASH_ITERLIMIT;
-+	*memlimit  = PHP_OPENSSL_PWHASH_MEMLIMIT;
-+	*threads   = PHP_OPENSSL_PWHASH_THREADS;
-+
-+	if (!options) {
-+		return SUCCESS;
-+	}
-+	if ((opt = zend_hash_str_find(options, "memory_cost", strlen("memory_cost")))) {
-+		zend_long smemlimit = zval_get_long(opt);
-+
-+		if ((smemlimit < 0) || (smemlimit < PHP_OPENSSL_MEMLIMIT_MIN) || (smemlimit > (PHP_OPENSSL_MEMLIMIT_MAX))) {
-+			zend_value_error("Memory cost is outside of allowed memory range");
-+			return FAILURE;
-+		}
-+		*memlimit = smemlimit;
-+	}
-+	if ((opt = zend_hash_str_find(options, "time_cost", strlen("time_cost")))) {
-+		zend_long siterlimit = zval_get_long(opt);
-+		if ((siterlimit < PHP_OPENSSL_ITERLIMIT_MIN) || (siterlimit > PHP_OPENSSL_ITERLIMIT_MAX)) {
-+			zend_value_error("Time cost is outside of allowed time range");
-+			return FAILURE;
-+		}
-+		*iterlimit = siterlimit;
-+	}
-+	if ((opt = zend_hash_str_find(options, "threads", strlen("threads"))) && (zval_get_long(opt) != 1)) {
-+		zend_long sthreads = zval_get_long(opt);
-+		if ((sthreads < PHP_OPENSSL_THREADS_MIN) || (sthreads > PHP_OPENSSL_THREADS_MAX)) {
-+			zend_value_error("Invalid number of threads");
-+			return FAILURE;
-+		}
-+		*threads = sthreads;
-+	}
-+	return SUCCESS;
-+}
-+
-+static bool php_openssl_argon2_compute_hash(
-+	const char *algo,
-+	uint32_t version, uint32_t memlimit, uint32_t iterlimit, uint32_t threads,
-+	const char *pass, size_t pass_len,
-+	const unsigned char *salt, size_t salt_len,
-+	unsigned char *hash, size_t hash_len)
-+{
-+	OSSL_PARAM params[7], *p = params;
-+	EVP_KDF *kdf = NULL;
-+	EVP_KDF_CTX *kctx = NULL;
-+	bool ret = false;
-+
-+	if (threads > 1) {
-+		if (OSSL_set_max_threads(NULL, threads) != 1) {
-+			goto fail;
-+		}
-+	}
-+	p = params;
-+	*p++ = OSSL_PARAM_construct_uint32(OSSL_KDF_PARAM_THREADS,
-+		&threads);
-+	*p++ = OSSL_PARAM_construct_uint32(OSSL_KDF_PARAM_ARGON2_LANES,
-+		&threads);
-+	*p++= OSSL_PARAM_construct_uint32(OSSL_KDF_PARAM_ITER,
-+		&iterlimit);
-+	*p++ = OSSL_PARAM_construct_uint32(OSSL_KDF_PARAM_ARGON2_MEMCOST,
-+		&memlimit);
-+	*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT,
-+		(void *)salt, salt_len);
-+	*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PASSWORD,
-+		(void *)pass, pass_len);
-+	*p++ = OSSL_PARAM_construct_end();
-+
-+	if ((kdf = EVP_KDF_fetch(NULL, algo, NULL)) == NULL) {
-+		goto fail;
-+	}
-+	if ((kctx = EVP_KDF_CTX_new(kdf)) == NULL) {
-+		goto fail;
-+	}
-+	if (EVP_KDF_derive(kctx, hash, hash_len, params) != 1) {
-+		zend_value_error("Unexpected failure hashing password");
-+		goto fail;
-+	}
-+
-+	ret = true;
-+
-+fail:
-+	EVP_KDF_free(kdf);
-+	EVP_KDF_CTX_free(kctx);
-+
-+	if (threads > 1) {
-+		OSSL_set_max_threads(NULL, 0);
-+	}
-+	return ret;
-+}
-+
-+static zend_string *php_openssl_argon2_hash(const zend_string *password, zend_array *options, const char *algo)
-+{
-+	uint32_t iterlimit, memlimit, threads, version = PHP_OPENSSL_ARGON_VERSION;
-+	zend_string *digest = NULL, *salt64 = NULL, *hash64 = NULL;
-+	unsigned char hash[PHP_OPENSSL_HASH_SIZE+1], salt[PHP_OPENSSL_SALT_SIZE+1];
-+
-+	if ((ZSTR_LEN(password) >= UINT32_MAX)) {
-+		zend_value_error("Password is too long");
-+		return NULL;
-+	}
-+	if (get_options(options, &memlimit, &iterlimit, &threads) == FAILURE) {
-+		return NULL;
-+	}
-+	if (RAND_bytes(salt, PHP_OPENSSL_SALT_SIZE) <= 0) {
-+		return NULL;
-+	}
-+
-+	if (!php_openssl_argon2_compute_hash(algo, version, memlimit, iterlimit, threads,
-+			ZSTR_VAL(password), ZSTR_LEN(password),	salt, PHP_OPENSSL_SALT_SIZE, hash, PHP_OPENSSL_HASH_SIZE)) {
-+		return NULL;
-+	}
-+
-+	hash64 = php_base64_encode(hash, PHP_OPENSSL_HASH_SIZE);
-+	/* No padding utsing 32 *4 / 3 = 42.6 (43 + 1 padding char)  */
-+	ZEND_ASSERT(ZSTR_LEN(hash64)==44 && ZSTR_VAL(hash64)[43]=='=');
-+	ZSTR_VAL(hash64)[43] = 0;
-+	ZSTR_LEN(hash64) = 43;
-+
-+	salt64 = php_base64_encode(salt, PHP_OPENSSL_SALT_SIZE);
-+	/* No padding using 16 *4 / 3 = 21.3 (22 + 2 padding char)  */
-+	ZEND_ASSERT(ZSTR_LEN(salt64)==24 && ZSTR_VAL(salt64)[22]=='=' && ZSTR_VAL(salt64)[23]=='=');
-+	ZSTR_VAL(salt64)[22] = 0;
-+	ZSTR_LEN(salt64) = 22;
-+
-+	digest = zend_string_alloc(PHP_OPENSSL_DIGEST_SIZE, 0);
-+	ZSTR_LEN(digest) = snprintf(ZSTR_VAL(digest), ZSTR_LEN(digest), "$%s$v=%d$m=%u,t=%u,p=%u$%s$%s",
-+		algo, version, memlimit, iterlimit, threads, ZSTR_VAL(salt64), ZSTR_VAL(hash64));
-+
-+	zend_string_release(salt64);
-+	zend_string_release(hash64);
-+
-+	return digest;
-+}
-+
-+static int php_openssl_argon2_extract(
-+	const zend_string *digest, uint32_t *version, uint32_t *memlimit, uint32_t *iterlimit,
-+	uint32_t *threads, zend_string **salt, zend_string **hash)
-+{
-+	const char *p;
-+	char *hash64, *salt64;
-+
-+	if (!digest || (ZSTR_LEN(digest) < sizeof("$argon2id$"))) {
-+		return FAILURE;
-+	}
-+	p = ZSTR_VAL(digest);
-+	if (!memcmp(p, "$argon2i$", strlen("$argon2i$"))) {
-+		p += strlen("$argon2i$");
-+	} else if (!memcmp(p, "$argon2id$", strlen("$argon2id$"))) {
-+		p += strlen("$argon2id$");
-+	} else {
-+		return FAILURE;
-+	}
-+	if (sscanf(p, "v=%" PRIu32 "$m=%" PRIu32 ",t=%" PRIu32 ",p=%" PRIu32,
-+		   version, memlimit, iterlimit, threads) != 4) {
-+		return FAILURE;
-+	}
-+	if (salt && hash) {
-+		/* start of param */
-+		p = strchr(p, '$');
-+		if (!p) {
-+			return FAILURE;
-+		}
-+		/* start of salt */
-+		p = strchr(p+1, '$');
-+		if (!p) {
-+			return FAILURE;
-+		}
-+		salt64 = estrdup(p+1);
-+		/* start of hash */
-+		hash64 = strchr(salt64, '$');
-+		if (!hash64) {
-+			efree(salt64);
-+			return FAILURE;
-+		}
-+		*hash64++ = 0;
-+		*salt = php_base64_decode((unsigned char *)salt64, strlen(salt64));
-+		*hash = php_base64_decode((unsigned char *)hash64, strlen(hash64));
-+		efree(salt64);
-+	}
-+	return SUCCESS;
-+}
-+
-+static bool php_openssl_argon2_verify(const zend_string *password, const zend_string *digest, const char *algo)
-+{
-+	uint32_t version, iterlimit, memlimit, threads;
-+	zend_string *salt, *hash, *new;
-+	bool ret = false;
-+
-+	if ((ZSTR_LEN(password) >= UINT32_MAX) || (ZSTR_LEN(digest) >= UINT32_MAX)) {
-+		return false;
-+	}
-+	if (FAILURE == php_openssl_argon2_extract(digest, &version, &memlimit, &iterlimit, &threads, &salt, &hash)) {
-+		return false;
-+	}
-+
-+	new = zend_string_alloc(ZSTR_LEN(hash), 0);
-+	if (php_openssl_argon2_compute_hash(algo, version, memlimit, iterlimit, threads,
-+			ZSTR_VAL(password), ZSTR_LEN(password),	(unsigned char *)ZSTR_VAL(salt),
-+			ZSTR_LEN(salt), (unsigned char *)ZSTR_VAL(new), ZSTR_LEN(new))) {
-+		ret = (php_safe_bcmp(hash, new) == 0);
-+	}
-+
-+	zend_string_release(new);
-+	zend_string_release(salt);
-+	zend_string_release(hash);
-+
-+	return ret;
-+}
-+
-+static bool php_openssl_argon2i_verify(const zend_string *password, const zend_string *digest)
-+{
-+	return php_openssl_argon2_verify(password, digest, "argon2i");
-+}
-+
-+static bool php_openssl_argon2id_verify(const zend_string *password, const zend_string *digest)
-+{
-+	return php_openssl_argon2_verify(password, digest, "argon2id");
-+}
-+
-+static bool php_openssl_argon2_needs_rehash(const zend_string *hash, zend_array *options)
-+{
-+	uint32_t version, iterlimit, memlimit, threads;
-+	uint32_t new_version = PHP_OPENSSL_ARGON_VERSION, new_iterlimit, new_memlimit, new_threads;
-+
-+	if (FAILURE == get_options(options, &new_memlimit, &new_iterlimit, &new_threads)) {
-+		return true;
-+	}
-+	if (FAILURE == php_openssl_argon2_extract(hash, &version, &memlimit, &iterlimit, &threads, NULL, NULL)) {
-+		return true;
-+	}
-+
-+	// Algo already checked in pasword_needs_rehash implementation
-+	return (version != new_version) ||
-+		(iterlimit != new_iterlimit) ||
-+		(memlimit != new_memlimit) ||
-+		(threads != new_threads);
-+}
-+
-+static int php_openssl_argon2_get_info(zval *return_value, const zend_string *hash)
-+{
-+	uint32_t v, threads;
-+	uint32_t memory_cost;
-+	uint32_t time_cost;
-+
-+	if (FAILURE == php_openssl_argon2_extract(hash, &v, &memory_cost, &time_cost, &threads, NULL, NULL)) {
-+		return FAILURE;
-+	}
-+	add_assoc_long(return_value, "memory_cost", memory_cost);
-+	add_assoc_long(return_value, "time_cost", time_cost);
-+	add_assoc_long(return_value, "threads", threads);
-+
-+	return SUCCESS;
-+}
-+
-+
-+static zend_string *php_openssl_argon2i_hash(const zend_string *password, zend_array *options)
-+{
-+	return php_openssl_argon2_hash(password, options, "argon2i");
-+}
-+
-+static const php_password_algo openssl_algo_argon2i = {
-+	"argon2i",
-+	php_openssl_argon2i_hash,
-+	php_openssl_argon2i_verify,
-+	php_openssl_argon2_needs_rehash,
-+	php_openssl_argon2_get_info,
-+	NULL,
-+};
-+
-+static zend_string *php_openssl_argon2id_hash(const zend_string *password, zend_array *options)
-+{
-+	return php_openssl_argon2_hash(password, options, "argon2id");
-+}
-+
-+static const php_password_algo openssl_algo_argon2id = {
-+	"argon2id",
-+	php_openssl_argon2id_hash,
-+	php_openssl_argon2id_verify,
-+	php_openssl_argon2_needs_rehash,
-+	php_openssl_argon2_get_info,
-+	NULL,
-+};
-+
-+PHP_FUNCTION(openssl_password_hash)
-+{
-+	zend_string *password, *algo, *digest;
-+	zend_array *options = NULL;
-+
-+	ZEND_PARSE_PARAMETERS_START(2, 3)
-+		Z_PARAM_STR(algo)
-+		Z_PARAM_STR(password)
-+		Z_PARAM_OPTIONAL
-+		Z_PARAM_ARRAY_HT(options)
-+	ZEND_PARSE_PARAMETERS_END();
-+
-+	if (strcmp(ZSTR_VAL(algo), "argon2i") && strcmp(ZSTR_VAL(algo), "argon2id")) {
-+		zend_argument_value_error(1, "must be a valid password openssl hashing algorithm");
-+		RETURN_THROWS();
-+	}
-+
-+	digest = php_openssl_argon2_hash(password, options, ZSTR_VAL(algo));
-+	if (!digest) {
-+		if (!EG(exception)) {
-+			zend_throw_error(NULL, "Password hashing failed for unknown reason");
-+		}
-+		RETURN_THROWS();
-+	}
-+
-+	RETURN_NEW_STR(digest);
-+}
-+
-+PHP_FUNCTION(openssl_password_verify)
-+{
-+	zend_string *password, *algo, *digest;
-+
-+	ZEND_PARSE_PARAMETERS_START(3, 3)
-+		Z_PARAM_STR(algo)
-+		Z_PARAM_STR(password)
-+		Z_PARAM_STR(digest)
-+	ZEND_PARSE_PARAMETERS_END();
-+
-+	if (strcmp(ZSTR_VAL(algo), "argon2i") && strcmp(ZSTR_VAL(algo), "argon2id")) {
-+		zend_argument_value_error(1, "must be a valid password openssl hashing algorithm");
-+		RETURN_THROWS();
-+	}
-+
-+	RETURN_BOOL(php_openssl_argon2_verify(password, digest, ZSTR_VAL(algo)));
-+}
-+
-+PHP_MINIT_FUNCTION(openssl_pwhash)
-+{
-+	zend_string *argon2i = ZSTR_INIT_LITERAL("argon2i", 1);
-+
-+	zend_register_functions(NULL, ext_functions, NULL, type);
-+
-+	if (php_password_algo_find(argon2i)) {
-+		/* Nothing to do. Core or sodium has registered these algorithms for us. */
-+		zend_string_release(argon2i);
-+		return SUCCESS;
-+	}
-+	zend_string_release(argon2i);
-+
-+	register_openssl_pwhash_symbols(module_number);
-+
-+	if (FAILURE == php_password_algo_register("argon2i", &openssl_algo_argon2i)) {
-+		return FAILURE;
-+	}
-+	if (FAILURE == php_password_algo_register("argon2id", &openssl_algo_argon2id)) {
-+		return FAILURE;
-+	}
-+
-+	return SUCCESS;
-+}
-+
-+PHP_MSHUTDOWN_FUNCTION(openssl_pwhash)
-+{
-+	zend_unregister_functions(ext_functions, -1, NULL);
-+
-+	return SUCCESS;
-+}
-+#endif /* PHP_OPENSSL_API_VERSION >= 0x30200 */
-diff --git a/ext/openssl/openssl_pwhash.stub.php b/ext/openssl/openssl_pwhash.stub.php
-new file mode 100644
-index 0000000000..85c2f04d55
---- /dev/null
-+++ b/ext/openssl/openssl_pwhash.stub.php
-@@ -0,0 +1,38 @@
-+<?php
-+
-+/** @generate-class-entries */
-+
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+/**
-+ * @var string
-+ */
-+const PASSWORD_ARGON2I = "argon2i";
-+/**
-+ * @var string
-+ */
-+const PASSWORD_ARGON2ID = "argon2id";
-+/**
-+ * @var int
-+ * @cvalue PHP_OPENSSL_PWHASH_MEMLIMIT
-+ */
-+const PASSWORD_ARGON2_DEFAULT_MEMORY_COST = UNKNOWN;
-+/**
-+ * @var int
-+ * @cvalue PHP_OPENSSL_PWHASH_ITERLIMIT
-+ */
-+const PASSWORD_ARGON2_DEFAULT_TIME_COST = UNKNOWN;
-+/**
-+ * @var int
-+ * @cvalue PHP_OPENSSL_PWHASH_THREADS
-+ */
-+const PASSWORD_ARGON2_DEFAULT_THREADS = UNKNOWN;
-+/**
-+ * @var string
-+ */
-+const PASSWORD_ARGON2_PROVIDER = "openssl";
-+
-+function openssl_password_hash(string $algo, #[\SensitiveParameter] string $password, array $options = []): string {}
-+function openssl_password_verify(string $algo, #[\SensitiveParameter] string $password, string $hash): bool {}
-+
-+#endif
-+
-diff --git a/ext/openssl/openssl_pwhash_arginfo.h b/ext/openssl/openssl_pwhash_arginfo.h
-new file mode 100644
-index 0000000000..f60a1f5b08
---- /dev/null
-+++ b/ext/openssl/openssl_pwhash_arginfo.h
-@@ -0,0 +1,68 @@
-+/* This is a generated file, edit the .stub.php file instead.
-+ * Stub hash: a01216f790c4c42499bd85448aacb3a6d58acc94 */
-+
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_password_hash, 0, 2, IS_STRING, 0)
-+	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
-+	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
-+	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
-+ZEND_END_ARG_INFO()
-+#endif
-+
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_password_verify, 0, 3, _IS_BOOL, 0)
-+	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
-+	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
-+	ZEND_ARG_TYPE_INFO(0, hash, IS_STRING, 0)
-+ZEND_END_ARG_INFO()
-+#endif
-+
-+
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+ZEND_FUNCTION(openssl_password_hash);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+ZEND_FUNCTION(openssl_password_verify);
-+#endif
-+
-+
-+static const zend_function_entry ext_functions[] = {
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	ZEND_FE(openssl_password_hash, arginfo_openssl_password_hash)
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	ZEND_FE(openssl_password_verify, arginfo_openssl_password_verify)
-+#endif
-+	ZEND_FE_END
-+};
-+
-+static void register_openssl_pwhash_symbols(int module_number)
-+{
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	REGISTER_STRING_CONSTANT("PASSWORD_ARGON2I", "argon2i", CONST_PERSISTENT);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	REGISTER_STRING_CONSTANT("PASSWORD_ARGON2ID", "argon2id", CONST_PERSISTENT);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	REGISTER_LONG_CONSTANT("PASSWORD_ARGON2_DEFAULT_MEMORY_COST", PHP_OPENSSL_PWHASH_MEMLIMIT, CONST_PERSISTENT);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	REGISTER_LONG_CONSTANT("PASSWORD_ARGON2_DEFAULT_TIME_COST", PHP_OPENSSL_PWHASH_ITERLIMIT, CONST_PERSISTENT);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	REGISTER_LONG_CONSTANT("PASSWORD_ARGON2_DEFAULT_THREADS", PHP_OPENSSL_PWHASH_THREADS, CONST_PERSISTENT);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+	REGISTER_STRING_CONSTANT("PASSWORD_ARGON2_PROVIDER", "openssl", CONST_PERSISTENT);
-+#endif
-+
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+
-+	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "openssl_password_hash", sizeof("openssl_password_hash") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
-+#endif
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+
-+	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "openssl_password_verify", sizeof("openssl_password_verify") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
-+#endif
-+}
-diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
-index 304854b4bf..9532cfe6f9 100644
---- a/ext/openssl/php_openssl.h
-+++ b/ext/openssl/php_openssl.h
-@@ -39,8 +39,10 @@ extern zend_module_entry openssl_module_entry;
- #define PHP_OPENSSL_API_VERSION 0x10002
- #elif OPENSSL_VERSION_NUMBER < 0x30000000L
- #define PHP_OPENSSL_API_VERSION 0x10100
--#else
-+#elif OPENSSL_VERSION_NUMBER < 0x30200000L
- #define PHP_OPENSSL_API_VERSION 0x30000
-+#else
-+#define PHP_OPENSSL_API_VERSION 0x30200
- #endif
- #endif
- 
-@@ -158,6 +160,33 @@ static inline php_openssl_certificate_object *php_openssl_certificate_from_obj(z
- 
- #define Z_OPENSSL_CERTIFICATE_P(zv) php_openssl_certificate_from_obj(Z_OBJ_P(zv))
- 
-+#if PHP_OPENSSL_API_VERSION >= 0x30200
-+/**
-+ * MEMLIMIT is normalized to KB even though sodium uses Bytes in order to
-+ * present a consistent user-facing API.
-+ *
-+ * When updating these values, synchronize ext/standard/php_password.h values.
-+ */
-+#if defined(PHP_PASSWORD_ARGON2_MEMORY_COST)
-+#define PHP_OPENSSL_PWHASH_MEMLIMIT PHP_PASSWORD_ARGON2_MEMORY_COST
-+#else
-+#define PHP_OPENSSL_PWHASH_MEMLIMIT (64 << 10)
-+#endif
-+#if defined(PHP_PASSWORD_ARGON2_TIME_COST)
-+#define PHP_OPENSSL_PWHASH_ITERLIMIT PHP_PASSWORD_ARGON2_TIME_COST
-+#else
-+#define PHP_OPENSSL_PWHASH_ITERLIMIT 4
-+#endif
-+#if defined(PHP_PASSWORD_ARGON2_THREADS)
-+#define PHP_OPENSSL_PWHASH_THREADS PHP_PASSWORD_ARGON2_THREADS
-+#else
-+#define PHP_OPENSSL_PWHASH_THREADS 1
-+#endif
-+
-+PHP_MINIT_FUNCTION(openssl_pwhash);
-+PHP_MSHUTDOWN_FUNCTION(openssl_pwhash);
-+#endif
-+
- PHP_MINIT_FUNCTION(openssl);
- PHP_MSHUTDOWN_FUNCTION(openssl);
- PHP_MINFO_FUNCTION(openssl);
-diff --git a/ext/openssl/tests/openssl_password.phpt b/ext/openssl/tests/openssl_password.phpt
-new file mode 100644
-index 0000000000..7881803038
---- /dev/null
-+++ b/ext/openssl/tests/openssl_password.phpt
-@@ -0,0 +1,42 @@
-+--TEST--
-+Basic features of password_hash
-+--EXTENSIONS--
-+openssl
-+--SKIPIF--
-+<?php
-+if (!function_exists('openssl_password_hash')) {
-+  echo "skip - No openssl_password_hash";
-+}
-+?>
-+--FILE--
-+<?php
-+
-+echo 'Argon2 provider: ';
-+var_dump(PASSWORD_ARGON2_PROVIDER);
-+
-+foreach([1, 2] as $mem) {
-+  foreach([1, 2] as $time) {
-+    $opts = [
-+      'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST / $mem,
-+      'time_cost'   => PASSWORD_ARGON2_DEFAULT_TIME_COST / $time,
-+      'threads'     => PASSWORD_ARGON2_DEFAULT_THREADS,
-+    ];
-+    foreach(['argon2i', 'argon2id'] as $algo) {
-+      $pass = "secret$mem$time$algo";
-+      $hash = openssl_password_hash($algo, $pass, $opts);
-+      var_dump(openssl_password_verify($algo, $pass, $hash));
-+    }
-+  }
-+}
-+?>
-+--EXPECTF--
-+Argon2 provider: string(%d) "%s"
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+
-diff --git a/ext/openssl/tests/openssl_password_compat.phpt b/ext/openssl/tests/openssl_password_compat.phpt
-new file mode 100644
-index 0000000000..0de683616a
---- /dev/null
-+++ b/ext/openssl/tests/openssl_password_compat.phpt
-@@ -0,0 +1,52 @@
-+--TEST--
-+Compatibility of password_hash (libsodium / openssl)
-+--EXTENSIONS--
-+openssl
-+sodium
-+--SKIPIF--
-+<?php
-+if (!function_exists('sodium_crypto_pwhash_str_verify')) {
-+  echo "skip - No crypto_pwhash_str_verify";
-+}
-+
-+if (!function_exists('openssl_password_hash')) {
-+  echo "skip - No crypto_pwhash_str_verify";
-+}
-+?>
-+--FILE--
-+<?php
-+
-+echo 'Argon2 provider: ';
-+var_dump(PASSWORD_ARGON2_PROVIDER);
-+
-+foreach([1, 2] as $mem) {
-+  foreach([1, 2] as $time) {
-+    $opts = [
-+      'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST / $mem,
-+      'time_cost'   => PASSWORD_ARGON2_DEFAULT_TIME_COST / $time,
-+      'threads'     => PASSWORD_ARGON2_DEFAULT_THREADS,
-+    ];
-+    $algo = 'argon2id';
-+    $pass = "secret$mem$time$algo";
-+
-+    /* hash with libsodium / verify with openssl */
-+    $hash = sodium_crypto_pwhash_str($pass, PASSWORD_ARGON2_DEFAULT_TIME_COST / $time, PASSWORD_ARGON2_DEFAULT_MEMORY_COST / $mem);
-+    var_dump(openssl_password_verify($algo, $pass, $hash));
-+
-+    /* hash with openssl / verify with libsodium */
-+    $hash = openssl_password_hash($algo, $pass, $opts);
-+    var_dump(sodium_crypto_pwhash_str_verify($hash, $pass));
-+  }
-+}
-+?>
-+--EXPECTF--
-+Argon2 provider: string(%d) "%s"
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+
-diff --git a/ext/openssl/tests/openssl_password_compat2.phpt b/ext/openssl/tests/openssl_password_compat2.phpt
-new file mode 100644
-index 0000000000..42cf8682fd
---- /dev/null
-+++ b/ext/openssl/tests/openssl_password_compat2.phpt
-@@ -0,0 +1,52 @@
-+--TEST--
-+Compatibility of password_hash (libargon2 / openssl)
-+--EXTENSIONS--
-+openssl
-+sodium
-+--SKIPIF--
-+<?php
-+if (PASSWORD_ARGON2_PROVIDER != "standard") {
-+  echo "skip - libargon2 not available";
-+}
-+
-+if (!function_exists('openssl_password_hash')) {
-+  echo "skip - No crypto_pwhash_str_verify";
-+}
-+?>
-+--FILE--
-+<?php
-+
-+echo 'Argon2 provider: ';
-+var_dump(PASSWORD_ARGON2_PROVIDER);
-+
-+foreach([1, 2] as $mem) {
-+  foreach([1, 2] as $time) {
-+    $opts = [
-+      'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST / $mem,
-+      'time_cost'   => PASSWORD_ARGON2_DEFAULT_TIME_COST / $time,
-+      'threads'     => PASSWORD_ARGON2_DEFAULT_THREADS,
-+    ];
-+    $algo = 'argon2id';
-+    $pass = "secret$mem$time$algo";
-+
-+    /* hash with libargon2 / verify with openssl */
-+    $hash = password_hash($pass, PASSWORD_ARGON2ID, $opts);
-+    var_dump(openssl_password_verify($algo, $pass, $hash));
-+
-+    /* hash with openssl / verify with libargon2 */
-+    $hash = openssl_password_hash($algo, $pass, $opts);
-+    var_dump(password_verify($pass, $hash));
-+  }
-+}
-+?>
-+--EXPECT--
-+Argon2 provider: string(8) "standard"
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+bool(true)
-+
--- 
-2.45.0
-

diff --git a/php-8.4.0-embed.patch b/php-8.4.0-embed.patch
new file mode 100644
index 0000000..ca4b403
--- /dev/null
+++ b/php-8.4.0-embed.patch
@@ -0,0 +1,25 @@
+diff -up ./sapi/embed/config.m4.embed ./sapi/embed/config.m4
+--- ./sapi/embed/config.m4.embed	2024-07-03 16:17:17.973277200 +0200
++++ ./sapi/embed/config.m4	2024-07-03 16:19:32.224546927 +0200
+@@ -12,7 +12,8 @@ if test "$PHP_EMBED" != "no"; then
+     [yes|shared], [
+       LIBPHP_CFLAGS="-shared"
+       PHP_EMBED_TYPE=shared
+-      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(orig_libdir); \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(orig_libdir)"
++      EXTRA_LDFLAGS="$EXTRA_LDFLAGS -release \$(PHP_MAJOR_VERSION).\$(PHP_MINOR_VERSION)"
++      INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(libdir); \$(LIBTOOL) --mode=install \$(INSTALL) -m 0755 \$(OVERALL_TARGET) \$(INSTALL_ROOT)\$(libdir)"
+     ],
+     [static], [
+       LIBPHP_CFLAGS="-static"
+diff -up ./scripts/php-config.in.embed ./scripts/php-config.in
+--- ./scripts/php-config.in.embed	2024-07-03 16:17:17.973277200 +0200
++++ ./scripts/php-config.in	2024-07-03 16:20:00.439654444 +0200
+@@ -19,7 +19,7 @@ exe_extension="@EXEEXT@"
+ php_cli_binary=NONE
+ php_cgi_binary=NONE
+ configure_options="@CONFIGURE_OPTIONS@"
+-php_sapis="@PHP_INSTALLED_SAPIS@"
++php_sapis="apache2handler litespeed fpm phpdbg @PHP_INSTALLED_SAPIS@"
+ ini_dir="@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
+ ini_path="@EXPANDED_PHP_CONFIG_FILE_PATH@"
+ php_embed_type="@PHP_EMBED_TYPE@"

diff --git a/php-8.4.0-httpd.patch b/php-8.4.0-httpd.patch
new file mode 100644
index 0000000..227468c
--- /dev/null
+++ b/php-8.4.0-httpd.patch
@@ -0,0 +1,21 @@
+Disable MPM detection
+
+mod_php is build twice
+- as NTS without option
+- as ZTS using --enable-maintainer-zts
+
+diff -up ./sapi/apache2handler/config.m4.mpmcheck ./sapi/apache2handler/config.m4
+--- ./sapi/apache2handler/config.m4.mpmcheck	2024-07-03 15:56:56.882370597 +0200
++++ ./sapi/apache2handler/config.m4	2024-07-03 15:59:15.967824949 +0200
+@@ -120,11 +120,6 @@ if test "$PHP_APXS2" != "no"; then
+       -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1
+     ])
+ 
+-  AS_IF([$APXS_HTTPD -V 2>/dev/null | grep 'threaded:.*yes' >/dev/null 2>&1], [
+-    APACHE_THREADED_MPM=yes
+-    enable_zts=yes
+-  ], [APACHE_THREADED_MPM=no])
+-
+ AC_CONFIG_COMMANDS([apache2handler], [AS_VAR_IF([enable_zts], [yes],,
+   [AS_VAR_IF([APACHE_THREADED_MPM], [no],
+     [AC_MSG_WARN([

diff --git a/php-8.4.0-includedir.patch b/php-8.4.0-includedir.patch
new file mode 100644
index 0000000..8d3fcff
--- /dev/null
+++ b/php-8.4.0-includedir.patch
@@ -0,0 +1,11 @@
+--- ./configure.ac.includedir
++++ ./configure.ac
+@@ -1368,7 +1368,7 @@
+ EXPANDED_DATADIR=$datadir
+ EXPANDED_PHP_CONFIG_FILE_PATH=$(eval echo "$PHP_CONFIG_FILE_PATH")
+ EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=$(eval echo "$PHP_CONFIG_FILE_SCAN_DIR")
+-INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
++INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR:${EXPANDED_DATADIR}/php:/usr/share/pear:/usr/share/php
+ 
+ exec_prefix=$old_exec_prefix
+ libdir=$old_libdir

diff --git a/php-8.4.0-ldap_r.patch b/php-8.4.0-ldap_r.patch
new file mode 100644
index 0000000..a574751
--- /dev/null
+++ b/php-8.4.0-ldap_r.patch
@@ -0,0 +1,19 @@
+
+Use -lldap_r by default.
+
+diff -up php-8.4.0beta1/ext/ldap/config.m4.ldap_r php-8.4.0beta1/ext/ldap/config.m4
+--- php-8.4.0beta1/ext/ldap/config.m4.ldap_r	2024-08-13 15:48:12.000000000 +0200
++++ php-8.4.0beta1/ext/ldap/config.m4	2024-08-13 16:23:24.744311776 +0200
+@@ -72,7 +72,11 @@ if test "$PHP_LDAP" != "no"; then
+   AH_TEMPLATE([HAVE_ORALDAP],
+     [Define to 1 if the ldap extension uses the Oracle Instant Client.])
+ 
+-  if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then
++  if test -f $LDAP_LIBDIR/libldap_r.$SHLIB_SUFFIX_NAME; then
++    PHP_ADD_LIBRARY_WITH_PATH(lber, [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD])
++    PHP_ADD_LIBRARY_WITH_PATH(ldap_r, [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD])
++
++  elif test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then
+     PHP_ADD_LIBRARY_WITH_PATH([lber], [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD])
+     PHP_ADD_LIBRARY_WITH_PATH([ldap], [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD])
+ 

diff --git a/php-8.4.0-libdb.patch b/php-8.4.0-libdb.patch
new file mode 100644
index 0000000..af7add0
--- /dev/null
+++ b/php-8.4.0-libdb.patch
@@ -0,0 +1,106 @@
+diff -up ./ext/dba/config.m4.libdb ./ext/dba/config.m4
+--- ./ext/dba/config.m4.libdb	2020-04-09 14:06:11.000000000 +0200
++++ ./ext/dba/config.m4	2020-04-09 14:35:08.208605065 +0200
+@@ -421,55 +421,7 @@ if test "$PHP_DB4" != "no"; then
+     /usr/local \
+     /usr \
+   ; do
+-    if test -f "$i/db5/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/db5/db.h
+-      break
+-    elif test -f "$i/db4/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/db4/db.h
+-      break
+-    elif test -f "$i/include/db5.3/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db5.3/db.h
+-      break
+-    elif test -f "$i/include/db5.1/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db5.1/db.h
+-      break
+-    elif test -f "$i/include/db5.0/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db5.0/db.h
+-      break
+-    elif test -f "$i/include/db4.8/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db4.8/db.h
+-      break
+-    elif test -f "$i/include/db4.7/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db4.7/db.h
+-      break
+-    elif test -f "$i/include/db4.6/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db4.6/db.h
+-      break
+-    elif test -f "$i/include/db4.5/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db4.5/db.h
+-      break
+-    elif test -f "$i/include/db4/db.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db4/db.h
+-      break
+-    elif test -f "$i/include/db/db4.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db/db4.h
+-      break
+-    elif test -f "$i/include/db4.h"; then
+-      THIS_PREFIX=$i
+-      THIS_INCLUDE=$i/include/db4.h
+-      break
+-    elif test -f "$i/include/db.h"; then
++    if test -f "$i/include/db.h"; then
+       THIS_PREFIX=$i
+       THIS_INCLUDE=$i/include/db.h
+       break
+@@ -477,20 +429,6 @@ if test "$PHP_DB4" != "no"; then
+   done
+   PHP_DBA_DB_CHECK([4],
+     [
+-      db-5.3
+-      db-5.1
+-      db-5.0
+-      db-4.8
+-      db-4.7
+-      db-4.6
+-      db-4.5
+-      db-4.4
+-      db-4.3
+-      db-4.2
+-      db-4.1
+-      db-4.0
+-      db-4
+-      db4
+       db
+     ],
+     [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
+diff -up ./ext/dba/dba.c.libdb ./ext/dba/dba.c
+--- ./ext/dba/dba.c.libdb	2020-04-09 14:06:11.000000000 +0200
++++ ./ext/dba/dba.c	2020-04-09 14:36:30.593275190 +0200
+@@ -49,6 +49,10 @@
+ #include "php_lmdb.h"
+ #include "dba_arginfo.h"
+ 
++#ifdef DB4_INCLUDE_FILE
++#include DB4_INCLUDE_FILE
++#endif
++
+ PHP_MINIT_FUNCTION(dba);
+ PHP_MSHUTDOWN_FUNCTION(dba);
+ PHP_MINFO_FUNCTION(dba);
+@@ -444,6 +448,10 @@ PHP_MINFO_FUNCTION(dba)
+ 
+ 	php_info_print_table_start();
+ 	php_info_print_table_row(2, "DBA support", "enabled");
++#ifdef DB_VERSION_STRING
++ 	php_info_print_table_row(2, "libdb header version", DB_VERSION_STRING);
++ 	php_info_print_table_row(2, "libdb library version", db_version(NULL, NULL, NULL));
++#endif
+ 	if (handlers.s) {
+ 		smart_str_0(&handlers);
+ 		php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));

diff --git a/php-8.4.0-phpinfo.patch b/php-8.4.0-phpinfo.patch
new file mode 100644
index 0000000..47bdbde
--- /dev/null
+++ b/php-8.4.0-phpinfo.patch
@@ -0,0 +1,44 @@
+
+Drop "Configure Command" from phpinfo as it doesn't
+provide any useful information.
+The available extensions are not related to this command.
+
+Replace full GCC name by gcc in php -v output
+
+
+diff -up ./ext/standard/info.c.phpinfo ./ext/standard/info.c
+--- ./ext/standard/info.c.phpinfo	2024-10-08 15:57:40.000000000 +0200
++++ ./ext/standard/info.c	2024-10-08 16:10:11.330510009 +0200
+@@ -814,9 +814,6 @@ PHPAPI ZEND_COLD void php_print_info(int
+ #ifdef PHP_BUILD_ARCH
+ 		php_info_print_table_row(2, "Architecture", PHP_BUILD_ARCH);
+ #endif
+-#ifdef CONFIGURE_COMMAND
+-		php_info_print_table_row(2, "Configure Command", CONFIGURE_COMMAND );
+-#endif
+ 
+ 		if (sapi_module.pretty_name) {
+ 			php_info_print_table_row(2, "Server API", sapi_module.pretty_name );
+diff -up ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo ./ext/standard/tests/general_functions/phpinfo.phpt
+--- ./ext/standard/tests/general_functions/phpinfo.phpt.phpinfo	2024-10-08 16:12:47.009579597 +0200
++++ ./ext/standard/tests/general_functions/phpinfo.phpt	2024-10-08 16:12:52.273784836 +0200
+@@ -17,7 +17,6 @@ PHP Version => %s
+ 
+ System => %s
+ Build Date => %r(.+?)%r
+-Configure Command => %s
+ Server API => Command Line Interface
+ Virtual Directory Support => %s
+ Configuration File (php.ini) Path => %s
+diff -up ./main/main.c.phpinfo ./main/main.c
+--- ./main/main.c.phpinfo	2024-10-08 15:57:40.000000000 +0200
++++ ./main/main.c	2024-10-08 16:10:11.331510049 +0200
+@@ -118,7 +118,7 @@ PHPAPI char *php_get_version(sapi_module
+ 		"NTS"
+ #endif
+ #ifdef PHP_BUILD_COMPILER
+-		" " PHP_BUILD_COMPILER
++		" gcc"
+ #endif
+ #ifdef PHP_BUILD_ARCH
+ 		" " PHP_BUILD_ARCH

diff --git a/php-8.4.0-phpize.patch b/php-8.4.0-phpize.patch
new file mode 100644
index 0000000..76c3ed5
--- /dev/null
+++ b/php-8.4.0-phpize.patch
@@ -0,0 +1,35 @@
+diff -up ./scripts/phpize.in.headers ./scripts/phpize.in
+--- ./scripts/phpize.in.headers	2019-07-23 10:05:11.000000000 +0200
++++ ./scripts/phpize.in	2019-07-23 10:18:13.648098089 +0200
+@@ -166,6 +166,15 @@ phpize_autotools()
+   $PHP_AUTOHEADER || exit 1
+ }
+ 
++phpize_check_headers()
++{
++  if test ! -f $includedir/main/php.h; then
++    echo "Can't find PHP headers in $includedir"
++    echo "The php-devel package is required for use of this command."
++    exit 1
++  fi
++}
++
+ # Main script
+ 
+ case "$1" in
+@@ -184,12 +193,15 @@ case "$1" in
+ 
+   # Version
+   --version|-v)
++    phpize_check_headers
+     phpize_print_api_numbers
+     exit 0
+   ;;
+ 
+   # Default
+   *)
++     phpize_check_headers
++
+      phpize_check_configm4 0
+ 
+      phpize_check_build_files

diff --git a/php-8.4.0-systzdata-v24.patch b/php-8.4.0-systzdata-v24.patch
new file mode 100644
index 0000000..6176a8b
--- /dev/null
+++ b/php-8.4.0-systzdata-v24.patch
@@ -0,0 +1,742 @@
+# License: MIT
+# http://opensource.org/licenses/MIT
+
+Add support for use of the system timezone database, rather
+than embedding a copy.  Discussed upstream but was not desired.
+
+History:
+r24: add internal UTC if tzdata is missing
+r23: fix possible buffer overflow
+r22: retrieve tzdata version from /usr/share/zoneinfo/tzdata.zi
+r21: adapt for timelib 2021.03 (in 8.1.0)
+r20: adapt for timelib 2020.03 (in 8.0.10RC1)
+r19: adapt for timelib 2020.02 (in 8.0.0beta2)
+r18: adapt for autotool change in 7.3.3RC1
+r17: adapt for timelib 2018.01 (in 7.3.2RC1)
+r16: adapt for timelib 2017.06 (in 7.2.3RC1)
+r15: adapt for timelib 2017.05beta7 (in 7.2.0RC1)
+r14: improve check for valid tz file
+r13: adapt for upstream changes to use PHP allocator
+r12: adapt for upstream changes for new zic
+r11: use canonical names to avoid more case sensitivity issues
+     round lat/long from zone.tab towards zero per builtin db
+r10: make timezone case insensitive
+r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
+r8: fix compile error without --with-system-tzdata configured
+r7: improve check for valid timezone id to exclude directories
+r6: fix fd leak in r5, fix country code/BC flag use in
+    timezone_identifiers_list() using system db,
+    fix use of PECL timezonedb to override system db,
+r5: reverts addition of "System/Localtime" fake tzname.
+    updated for 5.3.0, parses zone.tab to pick up mapping between
+    timezone name, country code and long/lat coords
+r4: added "System/Localtime" tzname which uses /etc/localtime
+r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
+r2: add filesystem trawl to set up name alias index
+r1: initial revision
+
+
+diff -up ./ext/date/config0.m4.systzdata ./ext/date/config0.m4
+--- ./ext/date/config0.m4.systzdata	2024-07-03 16:21:20.240786848 +0200
++++ ./ext/date/config0.m4	2024-07-03 16:25:14.838995464 +0200
+@@ -8,6 +8,18 @@
+   [PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -Wno-implicit-fallthrough"],,
+   [-Werror])
+ 
++PHP_ARG_WITH(system-tzdata, for use of system timezone data,
++  [AS_HELP_STRING([--with-system-tzdata[=DIR]],[to specify use of system timezone data])], no, no)
++
++if test "$PHP_SYSTEM_TZDATA" != "no"; then
++   AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
++
++   if test "$PHP_SYSTEM_TZDATA" != "yes"; then
++      AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
++                         [Define for location of system timezone data])
++   fi
++fi
++
+ PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
+ timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c
+                  lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
+diff -up ./ext/date/lib/parse_tz.c.systzdata ./ext/date/lib/parse_tz.c
+--- ./ext/date/lib/parse_tz.c.systzdata	2024-07-02 15:43:13.000000000 +0200
++++ ./ext/date/lib/parse_tz.c	2024-07-03 16:21:20.240786848 +0200
+@@ -26,9 +26,33 @@
+ #include "timelib.h"
+ #include "timelib_private.h"
+ 
++#ifdef HAVE_SYSTEM_TZDATA
++#include <sys/mman.h>
++#include <sys/stat.h>
++#include <limits.h>
++#include <fcntl.h>
++#include <unistd.h>
++
++#include "php_scandir.h"
++
++static const unsigned char internal_utc[] = {
++        0x54, 0x5a, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x54, 0x5a, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
++        0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x0a, 0x55, 0x54, 0x43,
++        0x30, 0x0a
++};
++
++#else
+ #define TIMELIB_SUPPORTS_V2DATA
+ #define TIMELIB_SUPPORT_SLIM_FILE
+ #include "timezonedb.h"
++#endif
++
++#include <ctype.h>
+ 
+ #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
+ # if defined(__LITTLE_ENDIAN__)
+@@ -95,6 +119,11 @@ static int read_php_preamble(const unsig
+ {
+ 	uint32_t version;
+ 
++	if (memcmp(*tzf, "TZif", 4) == 0) {
++		*tzf += 20;
++		return 0;
++	}
++
+ 	/* read ID */
+ 	version = (*tzf)[3] - '0';
+ 	*tzf += 4;
+@@ -577,7 +606,475 @@ void timelib_dump_tzinfo(timelib_tzinfo
+ 	}
+ }
+ 
+-static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb)
++#ifdef HAVE_SYSTEM_TZDATA
++
++#ifdef HAVE_SYSTEM_TZDATA_PREFIX
++#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
++#else
++#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
++#endif
++
++/* System timezone database pointer. */
++static const timelib_tzdb *timezonedb_system;
++
++/* Hash table entry for the cache of the zone.tab mapping table. */
++struct location_info {
++        char code[2];
++        double latitude, longitude;
++        char name[64];
++        char *comment;
++        struct location_info *next;
++};
++
++/* Cache of zone.tab. */
++static struct location_info **system_location_table;
++
++/* Size of the zone.tab hash table; a random-ish prime big enough to
++ * prevent too many collisions. */
++#define LOCINFO_HASH_SIZE (1021)
++
++/* Compute a case insensitive hash of str */
++static uint32_t tz_hash(const char *str)
++{
++    const unsigned char *p = (const unsigned char *)str;
++    uint32_t hash = 5381;
++    int c;
++
++    while ((c = tolower(*p++)) != '\0') {
++        hash = (hash << 5) ^ hash ^ c;
++    }
++
++    return hash % LOCINFO_HASH_SIZE;
++}
++
++/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
++ * parsed string on success, or NULL on parse error.  On success,
++ * writes the parsed number to *result. */
++static char *parse_iso6709(char *p, double *result)
++{
++    double v, sign;
++    char *pend;
++    size_t len;
++
++    if (*p == '+')
++        sign = 1.0;
++    else if (*p == '-')
++        sign = -1.0;
++    else
++        return NULL;
++
++    p++;
++    for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
++        ;;
++
++    /* Annoying encoding used by zone.tab has no decimal point, so use
++     * the length to determine the format:
++     * 
++     * 4 = DDMM
++     * 5 = DDDMM
++     * 6 = DDMMSS
++     * 7 = DDDMMSS
++     */
++    len = pend - p;
++    if (len < 4 || len > 7) {
++        return NULL;
++    }
++
++    /* p => [D]DD */
++    v = (p[0] - '0') * 10.0 + (p[1] - '0');
++    p += 2;
++    if (len == 5 || len == 7)
++        v = v * 10.0 + (*p++ - '0');
++    /* p => MM[SS] */
++    v += (10.0 * (p[0] - '0')
++          + p[1] - '0') / 60.0;
++    p += 2;
++    /* p => [SS] */
++    if (len > 5) {
++        v += (10.0 * (p[0] - '0')
++              + p[1] - '0') / 3600.0;
++        p += 2;
++    }
++
++    /* Round to five decimal place, not because it's a good idea,
++     * but, because the builtin data uses rounded data, so, match
++     * that. */
++    *result = trunc(v * sign * 100000.0) / 100000.0;
++
++    return p;
++}
++
++/* This function parses the zone.tab file to build up the mapping of
++ * timezone to country code and geographic location, and returns a
++ * hash table.  The hash table is indexed by the function:
++ *
++ *   tz_hash(timezone-name)
++ */
++static struct location_info **create_location_table(void)
++{
++    struct location_info **li, *i;
++    char zone_tab[PATH_MAX];
++    char line[512];
++    FILE *fp;
++
++    strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
++
++    fp = fopen(zone_tab, "r");
++    if (!fp) {
++        return NULL;
++    }
++
++    li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
++
++    while (fgets(line, sizeof line, fp)) {
++        char *p = line, *code, *name, *comment;
++        uint32_t hash;
++        double latitude, longitude;
++
++        while (isspace(*p))
++            p++;
++
++        if (*p == '#' || *p == '\0' || *p == '\n')
++            continue;
++        
++        if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
++            continue;
++        
++        /* code => AA */
++        code = p;
++        p[2] = 0;
++        p += 3;
++
++        /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
++        p = parse_iso6709(p, &latitude);
++        if (!p) {
++            continue;
++        }
++        p = parse_iso6709(p, &longitude);
++        if (!p) {
++            continue;
++        }
++
++        if (!p || *p != '\t') {
++            continue;
++        }
++
++        /* name = string */
++        name = ++p;
++        while (*p != '\t' && *p && *p != '\n')
++            p++;
++
++        *p++ = '\0';
++
++        /* comment = string */
++        comment = p;
++        while (*p != '\t' && *p && *p != '\n')
++            p++;
++
++        if (*p == '\n' || *p == '\t')
++            *p = '\0';
++        
++        hash = tz_hash(name);
++        i = malloc(sizeof *i);
++        memcpy(i->code, code, 2);
++        strncpy(i->name, name, sizeof i->name);
++        i->comment = strdup(comment);
++        i->longitude = longitude;
++        i->latitude = latitude;
++        i->next = li[hash];
++        li[hash] = i;
++        /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
++    }
++
++    fclose(fp);
++
++    return li;
++}
++
++/* Return location info from hash table, using given timezone name.
++ * Returns NULL if the name could not be found. */
++const struct location_info *find_zone_info(struct location_info **li, 
++                                           const char *name)
++{
++    uint32_t hash = tz_hash(name);
++    const struct location_info *l;
++
++    if (!li) {
++        return NULL;
++    }
++
++    for (l = li[hash]; l; l = l->next) {
++        if (timelib_strcasecmp(l->name, name) == 0)
++            return l;
++    }
++
++    return NULL;
++}    
++
++/* Filter out some non-tzdata files and the posix/right databases, if
++ * present. */
++static int index_filter(const struct dirent *ent)
++{
++	return strcmp(ent->d_name, ".") != 0
++		&& strcmp(ent->d_name, "..") != 0
++		&& strcmp(ent->d_name, "posix") != 0
++		&& strcmp(ent->d_name, "posixrules") != 0
++		&& strcmp(ent->d_name, "right") != 0
++		&& strstr(ent->d_name, ".list") == NULL
++		&& strstr(ent->d_name, ".tab") == NULL;
++}
++
++static int sysdbcmp(const void *first, const void *second)
++{
++        const timelib_tzdb_index_entry *alpha = first, *beta = second;
++
++        return timelib_strcasecmp(alpha->id, beta->id);
++}
++
++/* Retrieve tzdata version. */
++static void retrieve_zone_version(timelib_tzdb *db)
++{
++    static char buf[30];
++    char path[PATH_MAX];
++    FILE *fp;
++
++    strncpy(path, ZONEINFO_PREFIX "/tzdata.zi", sizeof(path));
++
++    fp = fopen(path, "r");
++    if (fp) {
++		if (fgets(buf, sizeof(buf), fp)) {
++			if (!memcmp(buf, "# version ", 10) &&
++				isdigit(buf[10]) &&
++				isdigit(buf[11]) &&
++				isdigit(buf[12]) &&
++				isdigit(buf[13]) &&
++				islower(buf[14])) {
++				if (buf[14] >= 't') {        /* 2022t = 2022.20 */
++					buf[17] = 0;
++					buf[16] = buf[14] - 't' + '0';
++					buf[15] = '2';
++				} else if (buf[14] >= 'j') { /* 2022j = 2022.10 */
++					buf[17] = 0;
++					buf[16] = buf[14] - 'j' + '0';
++					buf[15] = '1';
++				} else {                     /* 2022a = 2022.1  */
++					buf[16] = 0;
++					buf[15] = buf[14] - 'a' + '1';
++				}
++				buf[14] = '.';
++				db->version = buf+10;
++			}
++		}
++		fclose(fp);
++    }
++}
++
++
++/* Create the zone identifier index by trawling the filesystem. */
++static void create_zone_index(timelib_tzdb *db)
++{
++	size_t dirstack_size,  dirstack_top;
++	size_t index_size, index_next;
++	timelib_tzdb_index_entry *db_index;
++	char **dirstack;
++
++	/* LIFO stack to hold directory entries to scan; each slot is a
++	 * directory name relative to the zoneinfo prefix. */
++	dirstack_size = 32;
++	dirstack = malloc(dirstack_size * sizeof *dirstack);
++	dirstack_top = 1;
++	dirstack[0] = strdup("");
++	
++	/* Index array. */
++	index_size = 64;
++	db_index = malloc(index_size * sizeof *db_index);
++	index_next = 0;
++
++	do {
++		struct dirent **ents;
++		char name[PATH_MAX], *top;
++		int count;
++
++		/* Pop the top stack entry, and iterate through its contents. */
++		top = dirstack[--dirstack_top];
++		snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
++
++		count = php_scandir(name, &ents, index_filter, php_alphasort);
++
++		while (count > 0) {
++			struct stat st;
++			const char *leaf = ents[count - 1]->d_name;
++
++			snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s", 
++				 top, leaf);
++			
++			if (strlen(name) && stat(name, &st) == 0) {
++				/* Name, relative to the zoneinfo prefix. */
++				const char *root = top;
++
++				if (root[0] == '/') root++;
++
++				snprintf(name, sizeof name, "%s%s%s", root, 
++					 *root ? "/": "", leaf);
++
++				if (S_ISDIR(st.st_mode)) {
++					if (dirstack_top == dirstack_size) {
++						dirstack_size *= 2;
++						dirstack = realloc(dirstack, 
++								   dirstack_size * sizeof *dirstack);
++					}
++					dirstack[dirstack_top++] = strdup(name);
++				}
++				else {
++					if (index_next == index_size) {
++						index_size *= 2;
++						db_index = realloc(db_index,
++								   index_size * sizeof *db_index);
++					}
++
++					db_index[index_next++].id = strdup(name);
++				}
++			}
++
++			free(ents[--count]);
++		}
++		
++		if (count != -1) free(ents);
++		free(top);
++	} while (dirstack_top);
++
++        qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
++
++	if (!index_next) {
++		db_index[index_next++].id = strdup("UTC");
++	}
++	db->index = db_index;
++	db->index_size = index_next;
++
++	free(dirstack);
++}
++
++#define FAKE_HEADER "1234\0??\1??"
++#define FAKE_UTC_POS (7 - 4)
++
++/* Create a fake data segment for database 'sysdb'. */
++static void fake_data_segment(timelib_tzdb *sysdb,
++                              struct location_info **info)
++{
++        size_t n;
++        char *data, *p;
++        
++        data = malloc(3 * sysdb->index_size + sizeof(FAKE_HEADER) - 1);
++
++        p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
++
++        for (n = 0; n < sysdb->index_size; n++) {
++                const struct location_info *li;
++                timelib_tzdb_index_entry *ent;
++
++                ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
++
++                /* Lookup the timezone name in the hash table. */
++                if (strcmp(ent->id, "UTC") == 0) {
++                        ent->pos = FAKE_UTC_POS;
++                        continue;
++                }
++
++                li = find_zone_info(info, ent->id);
++                if (li) {
++                        /* If found, append the BC byte and the
++                         * country code; set the position for this
++                         * section of timezone data.  */
++                        ent->pos = (p - data) - 4;
++                        *p++ = '\1';
++                        *p++ = li->code[0];
++                        *p++ = li->code[1];
++                }
++                else {
++                        /* If not found, the timezone data can
++                         * point at the header. */
++                        ent->pos = 0;
++                }
++        }
++        
++        sysdb->data = (unsigned char *)data;
++}
++
++/* Returns true if the passed-in stat structure describes a
++ * probably-valid timezone file. */
++static int is_valid_tzfile(const struct stat *st, int fd)
++{
++	if (fd) {
++		char buf[20];
++		if (read(fd, buf, 20)!=20) {
++			return 0;
++		}
++		lseek(fd, SEEK_SET, 0);
++		if (memcmp(buf, "TZif", 4)) {
++			return 0;
++		}
++	}
++	return S_ISREG(st->st_mode) && st->st_size > 20;
++}
++
++/* To allow timezone names to be used case-insensitively, find the
++ * canonical name for this timezone, if possible. */
++static const char *canonical_tzname(const char *timezone)
++{
++    if (timezonedb_system) {
++        timelib_tzdb_index_entry *ent, lookup;
++
++        lookup.id = (char *)timezone;
++
++        ent = bsearch(&lookup, timezonedb_system->index,
++                      timezonedb_system->index_size, sizeof lookup,
++                      sysdbcmp);
++        if (ent) {
++            return ent->id;
++        }
++    }
++
++    return timezone;
++}
++
++/* Return the mmap()ed tzfile if found, else NULL.  On success, the
++ * length of the mapped data is placed in *length. */
++static char *map_tzfile(const char *timezone, size_t *length)
++{
++	char fname[PATH_MAX];
++	struct stat st;
++	char *p;
++	int fd;
++	
++	if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++		return NULL;
++	}
++
++	snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++	fd = open(fname, O_RDONLY);
++	if (fd == -1) {
++		if (strcmp(timezone, "UTC")) {
++			return NULL;
++		} else {
++			*length = sizeof(internal_utc);
++			return internal_utc;
++		}
++	} else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st, fd)) {
++		close(fd);
++		return NULL;
++	}
++
++	*length = st.st_size;
++	p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
++	close(fd);
++	
++	return p != MAP_FAILED ? p : NULL;
++}
++
++#endif
++
++static int inmem_seek_to_tz_position(const unsigned char **tzf, const char *timezone, const timelib_tzdb *tzdb)
+ {
+ 	int left = 0, right = tzdb->index_size - 1;
+ 
+@@ -603,9 +1100,49 @@ static int seek_to_tz_position(const uns
+ 	return 0;
+ }
+ 
++static int seek_to_tz_position(const unsigned char **tzf, const char *timezone,
++			       char **map, size_t *maplen,
++			       const timelib_tzdb *tzdb)
++{
++#ifdef HAVE_SYSTEM_TZDATA
++	if (tzdb == timezonedb_system) {
++		char *orig;
++
++		orig = map_tzfile(timezone, maplen);
++		if (orig == NULL) {
++			return 0;
++		}
++
++		(*tzf) = (unsigned char *)orig;
++		*map = orig;
++        return 1;
++	}
++	else
++#endif
++	{
++		return inmem_seek_to_tz_position(tzf, timezone, tzdb);
++	}
++}
++
+ const timelib_tzdb *timelib_builtin_db(void)
+ {
++#ifdef HAVE_SYSTEM_TZDATA
++	if (timezonedb_system == NULL) {
++		timelib_tzdb *tmp = malloc(sizeof *tmp);
++
++		tmp->version = "0";
++		tmp->data = NULL;
++		create_zone_index(tmp);
++		retrieve_zone_version(tmp);
++		system_location_table = create_location_table();
++		fake_data_segment(tmp, system_location_table);
++		timezonedb_system = tmp;
++	}
++
++	return timezonedb_system;
++#else
+ 	return &timezonedb_builtin;
++#endif
+ }
+ 
+ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
+@@ -617,7 +1154,32 @@ const timelib_tzdb_index_entry *timelib_
+ int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb)
+ {
+ 	const unsigned char *tzf;
+-	return (seek_to_tz_position(&tzf, timezone, tzdb));
++
++#ifdef HAVE_SYSTEM_TZDATA
++	if (tzdb == timezonedb_system) {
++		char fname[PATH_MAX];
++		struct stat st;
++
++		if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++			return 0;
++		}
++		if (!strcmp(timezone, "UTC")) {
++			return 1;
++		}
++		if (system_location_table) {
++			if (find_zone_info(system_location_table, timezone) != NULL) {
++				/* found in cache */
++				return 1;
++			}
++		}
++
++		snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++		return stat(fname, &st) == 0 && is_valid_tzfile(&st, 0);
++	}
++#endif
++
++	return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
+ }
+ 
+ static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
+@@ -662,6 +1224,8 @@ static timelib_tzinfo* timelib_tzinfo_ct
+ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code)
+ {
+ 	const unsigned char *tzf;
++	char *memmap = NULL;
++	size_t maplen;
+ 	timelib_tzinfo *tmp;
+ 	int version;
+ 	int transitions_result, types_result;
+@@ -669,7 +1233,7 @@ timelib_tzinfo *timelib_parse_tzfile(con
+ 
+ 	*error_code = TIMELIB_ERROR_NO_ERROR;
+ 
+-	if (seek_to_tz_position(&tzf, timezone, tzdb)) {
++	if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
+ 		tmp = timelib_tzinfo_ctor(timezone);
+ 
+ 		version = read_preamble(&tzf, tmp, &type);
+@@ -712,11 +1276,38 @@ timelib_tzinfo *timelib_parse_tzfile(con
+ 			return NULL;
+ 		}
+ 
++#ifdef HAVE_SYSTEM_TZDATA
++		if (memmap) {
++			const struct location_info *li;
++
++			/* TZif-style - grok the location info from the system database,
++			 * if possible. */
++
++			if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
++				tmp->location.comments = timelib_strdup(li->comment);
++				strncpy(tmp->location.country_code, li->code, 2);
++				tmp->location.longitude = li->longitude;
++				tmp->location.latitude = li->latitude;
++				tmp->bc = 1;
++			}
++			else {
++				set_default_location_and_comments(&tzf, tmp);
++			}
++
++			/* Now done with the mmap segment - discard it. */
++			if (memmap != internal_utc) {
++				munmap(memmap, maplen);
++			}
++		} else {
++#endif
+ 		if (type == TIMELIB_TZINFO_PHP) {
+ 			read_location(&tzf, tmp);
+ 		} else {
+ 			set_default_location_and_comments(&tzf, tmp);
+ 		}
++#ifdef HAVE_SYSTEM_TZDATA
++		}
++#endif
+ 	} else {
+ 		*error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE;
+ 		tmp = NULL;
+diff -up ./ext/date/php_date.c.systzdata ./ext/date/php_date.c
+--- ./ext/date/php_date.c.systzdata	2024-07-02 15:43:13.000000000 +0200
++++ ./ext/date/php_date.c	2024-07-03 16:21:20.240786848 +0200
+@@ -487,7 +487,11 @@ PHP_MINFO_FUNCTION(date)
+ 	php_info_print_table_row(2, "date/time support", "enabled");
+ 	php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION);
+ 	php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
++#ifdef HAVE_SYSTEM_TZDATA
++	php_info_print_table_row(2, "Timezone Database", "system");
++#else
+ 	php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
++#endif
+ 	php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
+ 	php_info_print_table_end();
+ 

diff --git a/php.spec b/php.spec
index e3892e1..0f92546 100644
--- a/php.spec
+++ b/php.spec
@@ -7,9 +7,9 @@
 #
 
 # API/ABI check
-%global apiver      20230831
-%global zendver     20230831
-%global pdover      20170320
+%global apiver      20240924
+%global zendver     20240924
+%global pdover      20240423
 
 # we don't want -z defs linker flag
 %undefine _strict_symbol_defs_build
@@ -18,7 +18,7 @@
 %global _hardened_build 1
 
 # version used for php embedded library soname
-%global embed_version 8.3
+%global embed_version 8.4
 
 %global mysql_sock %(mysql_config --socket 2>/dev/null || echo /var/lib/mysql/mysql.sock)
 
@@ -44,7 +44,6 @@
 %endif
 %bcond_without   freetds
 %bcond_without   sodium
-%bcond_without   pspell
 %bcond_without   tidy
 %bcond_without   db4
 %bcond_without   qdbm
@@ -53,18 +52,16 @@
 %bcond_with      firebird
 %bcond_with      freetds
 %bcond_with      sodium
-%bcond_with      pspell
 %bcond_with      tidy
 %bcond_with      db4
 %bcond_with      qdbm
 %endif
 %bcond_with      zts
 %bcond_with      modphp
-%bcond_with      imap
 %bcond_without   lmdb
 
-%global upver        8.3.12
-#global rcver        RC1
+%global upver        8.4.0
+%global rcver        RC2
 
 Summary: PHP scripting language for creating dynamic web sites
 Name: php
@@ -101,29 +98,27 @@ Source51: opcache-default.blacklist
 Source53: 20-ffi.ini
 
 # Build fixes
-Patch1: php-7.4.0-httpd.patch
-Patch5: php-7.2.0-includedir.patch
-Patch6: php-8.0.0-embed.patch
-Patch8: php-8.1.0-libdb.patch
+Patch1: php-8.4.0-httpd.patch
+Patch5: php-8.4.0-includedir.patch
+Patch6: php-8.4.0-embed.patch
+Patch8: php-8.4.0-libdb.patch
 
 # Functional changes
 # Use system nikic/php-parser
 Patch41: php-8.3.3-parser.patch
 # use system tzdata
-Patch42: php-8.3.11-systzdata-v24.patch
+Patch42: php-8.4.0-systzdata-v24.patch
 # See http://bugs.php.net/53436
 # + display PHP version backported from 8.4
-Patch43: php-7.4.0-phpize.patch
+Patch43: php-8.4.0-phpize.patch
 # Use -lldap_r for OpenLDAP
-Patch45: php-7.4.0-ldap_r.patch
+Patch45: php-8.4.0-ldap_r.patch
 # drop "Configure command" from phpinfo output
 # and only use gcc (instead of full version)
-Patch47: php-8.1.0-phpinfo.patch
+Patch47: php-8.4.0-phpinfo.patch
 # Always warn about missing curve_name
 # Both Fedora and RHEL do not support arbitrary EC parameters
 Patch48: php-8.3.0-openssl-ec-param.patch
-# Backport Argon2 password hashing in OpenSSL ext
-Patch49: php-8.3.7-argon2.patch
 
 # Upstream fixes (100+)
 
@@ -355,23 +350,6 @@ bytecode in the shared memory. This eliminates the stages of reading code from
 the disk and compiling it on future access. In addition, it applies a few
 bytecode optimization patterns that make code execution faster.
 
-%if %{with imap}
-%package imap
-Summary: A module for PHP applications that use IMAP
-# All files licensed under PHP version 3.01
-License:  PHP-3.01
-Requires: php-common%{?_isa} = %{version}-%{release}
-BuildRequires: pkgconfig(krb5)
-BuildRequires: pkgconfig(krb5-gssapi)
-BuildRequires: openssl-devel >= 1.0.2
-BuildRequires: libc-client-devel
-
-%description imap
-The php-imap module will add IMAP (Internet Message Access Protocol)
-support to PHP. IMAP is a protocol for retrieving and uploading e-mail
-messages on mail servers. PHP is an HTML-embedded scripting language.
-%endif
-
 %package ldap
 Summary: A module for PHP applications that use LDAP
 # All files licensed under PHP version 3.01
@@ -643,19 +621,6 @@ Provides: php-embedded-devel%{?_isa} = %{version}-%{release}
 The php-embedded package contains a library which can be embedded
 into applications to provide PHP scripting language support.
 
-%if %{with pspell}
-%package pspell
-Summary: A module for PHP applications for using pspell interfaces
-# All files licensed under PHP version 3.01
-License:  PHP-3.01
-Requires: php-common%{?_isa} = %{version}-%{release}
-BuildRequires: aspell-devel >= 0.50.0
-
-%description pspell
-The php-pspell package contains a dynamic shared object that will add
-support for using the pspell library to PHP.
-%endif
-
 %package intl
 Summary: Internationalization extension for PHP applications
 # All files licensed under PHP version 3.01
@@ -730,7 +695,6 @@ in pure PHP.
 %patch -P45 -p1 -b .ldap_r
 %patch -P47 -p1 -b .phpinfo
 %patch -P48 -p1 -b .ec-param
-%patch -P49 -p1 -b .argon2
 
 # upstream patches
 
@@ -891,6 +855,7 @@ ln -sf ../configure
     --with-exec-dir=%{_bindir} \
     --without-gdbm \
     --with-openssl \
+    --with-openssl-argon2 \
     --with-system-ciphers \
     --with-external-pcre \
     --with-external-libcrypt \
@@ -899,7 +864,6 @@ ln -sf ../configure
 %endif
     --with-zlib \
     --with-layout=GNU \
-    --with-kerberos \
     --with-libxml \
     --with-system-tzdata \
     --with-mhash \
@@ -924,9 +888,6 @@ build --libdir=%{_libdir}/php \
       --enable-opcache \
       --with-capstone \
       --enable-phpdbg --enable-phpdbg-readline \
-%if %{with imap}
-      --with-imap=shared --with-imap-ssl \
-%endif
       --enable-mbstring=shared \
       --enable-mbregex \
       --enable-gd=shared \
@@ -979,9 +940,6 @@ build --libdir=%{_libdir}/php \
       --with-sqlite3=shared \
       --without-readline \
       --with-libedit \
-%if %{with pspell}
-      --with-pspell=shared \
-%endif
       --enable-phar=shared \
 %if %{with tidy}
       --with-tidy=shared,%{_prefix} \
@@ -1009,7 +967,6 @@ without_shared="--without-gd \
       --disable-xmlreader --disable-xmlwriter \
       --without-sodium \
       --without-sqlite3 --disable-phar --disable-fileinfo \
-      --without-pspell \
       --without-curl --disable-posix --disable-xml \
       --disable-simplexml --disable-exif --without-gettext \
       --without-iconv --disable-ftp --without-bz2 --disable-ctype \
@@ -1061,9 +1018,6 @@ build --includedir=%{_includedir}/php-zts \
       --enable-pcntl \
       --enable-opcache \
       --with-capstone \
-%if %{with imap}
-      --with-imap=shared --with-imap-ssl \
-%endif
       --enable-mbstring=shared \
       --enable-mbregex \
       --enable-gd=shared \
@@ -1117,9 +1071,6 @@ build --includedir=%{_includedir}/php-zts \
       --with-sqlite3=shared \
       --without-readline \
       --with-libedit \
-%if %{with pspell}
-      --with-pspell=shared \
-%endif
       --enable-phar=shared \
 %if %{with tidy}
       --with-tidy=shared,%{_prefix} \
@@ -1263,9 +1214,6 @@ TESTCMD="$TESTCMD --define extension_dir=$RPM_BUILD_ROOT%{_libdir}/php/modules"
 
 # Generate files lists and stub .ini files for each subpackage
 for mod in pgsql odbc ldap snmp \
-%if %{with imap}
-    imap \
-%endif
     mysqlnd mysqli \
     mbstring gd dom xsl soap bcmath dba \
     simplexml bz2 calendar ctype exif ftp gettext gmp iconv \
@@ -1276,9 +1224,6 @@ for mod in pgsql odbc ldap snmp \
 %if %{with tidy}
     tidy \
 %endif
-%if %{with pspell}
-    pspell \
-%endif
     curl \
 %if %{with sodium}
     sodium \
@@ -1514,9 +1459,6 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
 
 %files pgsql -f files.pgsql
 %files odbc -f files.odbc
-%if %{with imap}
-%files imap -f files.imap
-%endif
 %files ldap -f files.ldap
 %files snmp -f files.snmp
 %files xml -f files.xml
@@ -1535,9 +1477,6 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
 %if %{with freetds}
 %files pdo-dblib -f files.pdo_dblib
 %endif
-%if %{with pspell}
-%files pspell -f files.pspell
-%endif
 %files intl -f files.intl
 %files process -f files.process
 %if %{with firebird}
@@ -1558,6 +1497,11 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
 
 
 %changelog
+* Mon Oct 14 2024 Remi Collet <remi@remirepo.net> - 8.4.0~RC2-1
+- Update to 8.4.0RC2 for https://fedoraproject.org/wiki/Changes/php84
+- bump ABI/API numbers
+- drop pspell and imap extensions
+
 * Wed Sep 25 2024 Remi Collet <remi@remirepo.net> - 8.3.12-1
 - Update to 8.3.12 - http://www.php.net/releases/8_3_12.php
 

diff --git a/sources b/sources
index 46b87be..8aa79d6 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (php-8.3.12.tar.xz) = 2c4b440fa52950c75934559e977f39a179d1ad9edf8a17fe1b9ff89b58fbcafffb1bc1d59b6df46a9631554f0255c9271d906238c59287c799d195459be3e6a3
-SHA512 (php-8.3.12.tar.xz.asc) = c9b72a7d6dca695f3498aa720a4fbf18771e3b6132e432f4c8fc764a15bdb2b9d5db97f8b6064f1291f7e1ec1a59c3ddec3d79c8a1bbfe68d7bf29f666998f47
+SHA512 (php-8.4.0RC2.tar.xz) = e19488ebabccad954f2499872ddf009ca3a9afa75cb5bb8c2fd3e9ae8f2ca859a89d13b6fca4720178c1741004e28fe3b60d04ea9abeeed70e5c457c5e41f9ea
+SHA512 (php-8.4.0RC2.tar.xz.asc) = cfbfa6fe89781558d2a1996f06c0b35347453218ffd241dc268710c8ecc0ed026212f415c1c5ab18e00087fbbe8b6df5f878ca8d7ff217cdce94fe2f9aef142b

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-27  7:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27  7:33 [rpms/php] private-php86: Update to 8.4.0RC2 for https://fedoraproject.org/wiki/Changes/php84 Remi Collet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox