[packages/php] Up to 8.5.0beta1 (opcache is now always built in; drop fpm patch that was rejected by upstream)
arekm
arekm at pld-linux.org
Thu Aug 28 19:04:18 CEST 2025
commit 689b8385d825edc0cdcd0b7a5ca1b6cddba7d06a
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Aug 28 19:03:57 2025 +0200
Up to 8.5.0beta1 (opcache is now always built in; drop fpm patch that was rejected by upstream)
php-fcgi-graceful.patch | 78 -----------------------------------------
php-ini.patch | 14 ++++----
php-sapi-ini-file.patch | 36 ++++++++-----------
php-systzdata.patch | 12 +++----
php-zlib-for-getimagesize.patch | 9 ++---
php.spec | 54 ++++++----------------------
6 files changed, 43 insertions(+), 160 deletions(-)
---
diff --git a/php.spec b/php.spec
index e4f9c86..f84fc9a 100644
--- a/php.spec
+++ b/php.spec
@@ -51,7 +51,6 @@
%bcond_without mysqli # mysqli support (Requires mysql >= 4.1)
%bcond_without mysqlnd # mysqlnd support in mysql related extensions
%bcond_without odbc # ODBC extension module
-%bcond_without opcache # Enable Zend OPcache extension support
%bcond_without openssl # OpenSSL support and OpenSSL extension (module)
%bcond_without pcntl # pcntl extension module
%bcond_without pcre_jit # PCRE JIT
@@ -130,7 +129,7 @@
%define orgname php
%define ver_suffix 85
%define php_suffix %{!?with_default_php:%{ver_suffix}}
-%define subver alpha1
+%define subver beta1
%define rel 0.1
Summary: PHP: Hypertext Preprocessor
Summary(fr.UTF-8): Le langage de script embarque-HTML PHP
@@ -149,8 +148,8 @@ License: PHP 3.01 and Zend and BSD
Group: Libraries
#XSource0: https://www.php.net/distributions/%{orgname}-%{version}.tar.xz
# XSource0-md5: b73a7c365a7e75905745528d218cf128
-Source0: https://downloads.php.net/~daniels/php-%{version}%{subver}.tar.xz
-# Source0-md5: 75498754fc2cf772d0377f24c76b4730
+Source0: https://downloads.php.net/~edorian/php-%{version}%{subver}.tar.xz
+# Source0-md5: feb40d030b3c5fe0432dbeea249e346f
Source1: opcache.ini
Source2: %{orgname}-mod_php.conf
Source3: %{orgname}-cgi-fcgi.ini
@@ -180,7 +179,7 @@ Patch23: %{orgname}-builddir.patch
Patch24: %{orgname}-zlib-for-getimagesize.patch
Patch27: %{orgname}-config-dir.patch
-Patch29: %{orgname}-fcgi-graceful.patch
+
Patch31: %{orgname}-fcgi-error_log-no-newlines.patch
Patch39: %{orgname}-use-prog_sendmail.patch
Patch41: %{orgname}-fpm-config.patch
@@ -200,7 +199,7 @@ BuildRequires: autoconf >= 2.59
BuildRequires: automake >= 1.4d
BuildRequires: bison >= 3.0.0
BuildRequires: bzip2-devel >= 1.0.0
-%{?with_opcache:BuildRequires: capstone-devel >= 3.0.0}
+BuildRequires: capstone-devel >= 3.0.0
%{?with_curl:BuildRequires: curl-devel >= 7.61.0}
BuildRequires: cyrus-sasl-devel >= 2
BuildRequires: db-devel >= 4.0
@@ -220,7 +219,7 @@ BuildRequires: gmp-devel >= 4.2
%{?with_argon2:BuildRequires: libargon2-devel >= 20161029}
%{?with_avif:BuildRequires: libavif-devel >= 0.8.2}
%{?with_ffi:BuildRequires: libffi-devel >= 7:3.0.11}
-%{?with_intl:BuildRequires: libicu-devel >= 50.1}
+%{?with_intl:BuildRequires: libicu-devel >= 57.1}
BuildRequires: libjpeg-devel
BuildRequires: libltdl-devel >= 1.4
BuildRequires: libpng-devel >= 1.0.8
@@ -564,6 +563,7 @@ Obsoletes: php-hwapi < 4:5.2.0
Obsoletes: php-hyperwave < 3:5.0.0
Obsoletes: php-java < 3:5.0.0
Obsoletes: php-mcal < 3:5.0.0
+Obsoletes: php85-opcache < 4:8.5.0
Obsoletes: php-pcre < 4:5.3.28-7
Obsoletes: php-pecl-domxml
Obsoletes: php-pecl-hash < %{hashver}
@@ -1142,31 +1142,6 @@ Moduł PHP ze wsparciem dla ODBC.
%description odbc -l pt_BR.UTF-8
Um módulo para aplicações PHP que usam ODBC.
-%package opcache
-Summary: Zend Optimizer+ - PHP code optimizer
-Summary(pl.UTF-8): Zend Optimizer+ - optymalizator kodu PHP
-Group: Libraries
-URL: https://wiki.php.net/rfc/optimizerplus
-Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Requires: %{name}-pcre = %{epoch}:%{version}-%{release}
-Provides: php(opcache) = %{version}
-
-%description opcache
-The Zend OPcache provides faster PHP execution through opcode caching
-and optimization. It improves PHP performance by storing precompiled
-script 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.
-
-%description opcache -l pl.UTF-8
-Zend OPcache zapewnia szybsze wykonywanie kodu PHP dzięki buforowaniu
-i optymalizacji na poziomie opcode'ów. Poprawia wydajność PHP
-przechowując prekompilowany bajtkod skryptu w pamięci współdzielonej.
-Eliminuje etapy odczytu kodu z dysku i kompilacji przy późniejszym
-dostępie. Ponadto wykonuje kilka wzorców optymalizacji bajtkodu,
-czyniąc wykonywanie kodu szybszym.
-
%package openssl
Summary: OpenSSL extension module for PHP
Summary(pl.UTF-8): Moduł OpenSSL dla PHP
@@ -1792,7 +1767,7 @@ cp -p php.ini-production php.ini
%patch -P24 -p1 -b .zlib-for-getimagesize
%patch -P27 -p1
-%patch -P29 -p1
+
%patch -P31 -p1
%patch -P39 -p1 -b .use-prog_sendmail
%patch -P41 -p1
@@ -2094,7 +2069,7 @@ for sapi in $sapis; do
--enable-option-checking=fatal \
%{__enable_disable bcmath bcmath shared} \
%{__enable_disable calendar calendar shared} \
- %{?with_opcache:--with-capstone} \
+ --with-capstone \
%{__enable_disable ctype ctype shared} \
%{__enable_disable dba dba shared} \
%{__enable_disable dom dom shared} \
@@ -2158,7 +2133,6 @@ for sapi in $sapis; do
%{?with_mm:--with-mm} \
%{?with_mysqlnd:--enable-mysqlnd=shared} \
%{?with_mysqli:--with-mysqli=shared,%{!?with_mysqlnd:/usr/bin/mysql_config}%{?with_mysqlnd:mysqlnd}} \
- %{__enable_disable opcache opcache shared} \
%{?with_openssl:--with-openssl=shared} \
--with-tcadb=/usr \
--with-external-libcrypt \
@@ -2573,7 +2547,6 @@ fi \
%extension_scripts mysqli
%extension_scripts mysqlnd
%extension_scripts odbc
-%extension_scripts opcache
%extension_scripts openssl
%extension_scripts pcntl
%extension_scripts pdo
@@ -2697,6 +2670,7 @@ fi
%dir %{_sysconfdir}/conf.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php.ini
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/timezone.ini
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/opcache.ini
%attr(755,root,root) %{_libdir}/libphp_common-*.so
%dir %{php_extensiondir}
@@ -2902,14 +2876,6 @@ fi
%attr(755,root,root) %{php_extensiondir}/odbc.so
%endif
-%if %{with opcache}
-%files opcache
-%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/??_opcache.ini
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/opcache.ini
-%attr(755,root,root) %{php_extensiondir}/opcache.so
-%endif
-
%if %{with openssl}
%files openssl
%defattr(644,root,root,755)
diff --git a/php-fcgi-graceful.patch b/php-fcgi-graceful.patch
deleted file mode 100644
index 4c26509..0000000
--- a/php-fcgi-graceful.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-Related links:
-
-http://bugs.php.net/bug.php?id=43224 this patch
-
-http://bugs.php.net/bug.php?id=41593
-http://bugs.php.net/bug.php?id=36158
-http://php-fpm.anight.org/
-
-test script too:
-<?php
-echo php_sapi_name(), ' running ', PHP_VERSION, "<br>\n";
-$i = 0;
-while ($i < 35) {
- echo (++$i), "<br>\n";
- flush();
- sleep(1);
-}
-echo "end!<br>\n";
-?>
-
---- php-7.1.0alpha2/sapi/cgi/cgi_main.c~ 2016-07-04 14:56:49.000000000 +0300
-+++ php-7.1.0alpha2/sapi/cgi/cgi_main.c 2016-07-04 14:58:17.522958766 +0300
-@@ -117,6 +117,9 @@ static int children = 0;
- */
- static int parent = 1;
-
-+/* Socket we are listening on incoming connections */
-+static int fcgi_fd = 0;
-+
- #ifndef PHP_WIN32
- /* Did parent received exit signals SIG_TERM/SIG_INT/SIG_QUIT */
- static volatile sig_atomic_t exit_signal = 0;
-@@ -1221,6 +1224,21 @@
- }
- #endif
-
-+/**
-+ * Graceful shutdown. Close listening sockets.
-+ */
-+void fastcgi_graceful_shutdown(int signal)
-+{
-+#ifdef DEBUG_FASTCGI
-+ fprintf(stderr, "FastCGI graceful shutdown, pid %d\n", getpid());
-+#endif
-+
-+ /* Close the listening socket so new processes can reuse the same port */
-+ closesocket(fcgi_fd);
-+ fcgi_fd = 0;
-+}
-+
-+
- PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("cgi.rfc2616_headers", "0", PHP_INI_ALL, OnUpdateBool, rfc2616_headers, php_cgi_globals_struct, php_cgi_globals)
- STD_PHP_INI_BOOLEAN("cgi.nph", "0", PHP_INI_ALL, OnUpdateBool, nph, php_cgi_globals_struct, php_cgi_globals)
-@@ -1764,7 +1764,6 @@
- int requests = 0;
- int fastcgi;
- char *bindpath = NULL;
-- int fcgi_fd = 0;
- fcgi_request *request = NULL;
- int warmup_repeats = 0;
- int repeats = 1;
-@@ -2080,9 +2080,14 @@
- parent = 0;
-
- /* don't catch our signals */
-- sigaction(SIGTERM, &old_term, 0);
- sigaction(SIGQUIT, &old_quit, 0);
- sigaction(SIGINT, &old_int, 0);
-+
-+ /* call graceful shutdown handler for SIGTERM */
-+ act.sa_flags = 0;
-+ act.sa_handler = fastcgi_graceful_shutdown;
-+ sigaction(SIGTERM, &act, &old_term);
-+
- zend_signal_init();
- break;
- case -1:
diff --git a/php-ini.patch b/php-ini.patch
index b3ba62e..053569c 100644
--- a/php-ini.patch
+++ b/php-ini.patch
@@ -134,12 +134,12 @@
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
-@@ -863,49 +863,8 @@ default_socket_timeout = 60
+@@ -870,51 +870,8 @@ default_socket_timeout = 60
; deprecated in a future PHP major version. So, when it is possible, please
; move to the new ('extension=<ext>) syntax.
;
-; Notes for Windows environments :
-+; In PLD Linux you can install appropriate php84-<extension> or php84-pecl-<extension> package.
++; In PLD Linux you can install appropriate php85-<extension> or php85-pecl-<extension> package.
;
-; - Many DLL files are located in the ext/
-; extension folders as well as the separate PECL DLL download.
@@ -180,11 +180,13 @@
-;extension=xsl
-;extension=zip
-
--;zend_extension=opcache
+-;;;;;;;;;;;;;;;;;;;
+-; Module Settings ;
+-;;;;;;;;;;;;;;;;;;;
-
- ;;;;;;;;;;;;;;;;;;;
- ; Module Settings ;
- ;;;;;;;;;;;;;;;;;;;
+ [CLI Server]
+ ; Whether the CLI web server uses ANSI color coding in its terminal output.
+ cli_server.color = On
@@ -954,8 +867,9 @@
[Date]
diff --git a/php-sapi-ini-file.patch b/php-sapi-ini-file.patch
index 5da800a..02a3c14 100644
--- a/php-sapi-ini-file.patch
+++ b/php-sapi-ini-file.patch
@@ -25,29 +25,30 @@ $ php -r 'var_dump(array(get_cfg_var("cfg_file_path"),php_ini_loaded_file()));'
https://github.com/pld-linux/php/commit/762ec2e
---- php-8.0.0rc1/main/php_ini.c~ 2020-10-09 18:15:48.000000000 +0300
-+++ php-8.0.0rc1/main/php_ini.c 2020-10-09 18:42:20.087488856 +0300
-@@ -65,6 +65,11 @@
- PHPAPI char *php_ini_scanned_path=NULL;
- PHPAPI char *php_ini_scanned_files=NULL;
+
+--- php-8.5.0beta1/main/php_ini.c~ 2025-08-28 15:40:36.544074056 +0200
++++ php-8.5.0beta1/main/php_ini.c 2025-08-28 15:50:43.598534290 +0200
+@@ -410,6 +410,11 @@ static void append_ini_path(char *php_in
+ strlcat(php_ini_search_path, path, search_path_size);
+ }
+static int php_csort(const struct dirent **a, const struct dirent **b)
+{
-+ return strcmp((*a)->d_name,(*b)->d_name);
++ return strcmp((*a)->d_name,(*b)->d_name);
+}
+
- /* {{{ php_ini_displayer_cb */
- static ZEND_COLD void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
+ /* {{{ php_init_config */
+ void php_init_config(void)
{
-@@ -661,12 +666,14 @@ int php_init_config(void)
+@@ -640,12 +645,14 @@ void php_init_config(void)
+ char *p;
zend_llist scanned_ini_list;
- zend_llist_element *element;
- int l, total_l = 0;
+ size_t total_l = 0;
+ const char *fmt = "%s:" PHP_CONFIG_FILE_PATH "/%s.d";
char *bufpath, *debpath, *endpath;
- int lenpath;
+ size_t lenpath;
- zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
+ zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, true);
- bufpath = estrdup(php_ini_scanned_path);
+ bufpath = emalloc(strlen(php_ini_scanned_path) + strlen(fmt) + strlen(sapi_module.name));
@@ -55,12 +56,3 @@ https://github.com/pld-linux/php/commit/762ec2e
for (debpath = bufpath ; debpath ; debpath=endpath) {
endpath = strchr(debpath, DEFAULT_DIR_SEPARATOR);
if (endpath) {
-@@ -679,7 +686,7 @@ int php_init_config(void)
- }
- lenpath = (int)strlen(debpath);
-
-- if (lenpath > 0 && (ndir = php_scandir(debpath, &namelist, 0, php_alphasort)) > 0) {
-+ if (lenpath > 0 && (ndir = php_scandir(debpath, &namelist, 0, php_csort)) > 0) {
-
- for (i = 0; i < ndir; i++) {
-
diff --git a/php-systzdata.patch b/php-systzdata.patch
index 961f2e0..92be266 100644
--- a/php-systzdata.patch
+++ b/php-systzdata.patch
@@ -39,9 +39,9 @@ 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])
+@@ -14,6 +14,18 @@ PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I at ext
+ AX_CHECK_COMPILE_FLAG([-fwrapv],
+ [PHP_TIMELIB_CFLAGS="$PHP_TIMELIB_CFLAGS -fwrapv"])
+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)
@@ -55,9 +55,9 @@ diff -up ./ext/date/config0.m4.systzdata ./ext/date/config0.m4
+ fi
+fi
+
- PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -DHAVE_TIMELIB_CONFIG_H=1"
- PHP_TIMELIB_CFLAGS="$PHP_DATE_CFLAGS"
- PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I at ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=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
diff --git a/php-zlib-for-getimagesize.patch b/php-zlib-for-getimagesize.patch
index c09db17..50a0ed5 100644
--- a/php-zlib-for-getimagesize.patch
+++ b/php-zlib-for-getimagesize.patch
@@ -15,21 +15,22 @@ upstream: https://github.com/php/php-src/pull/4681
#include "zlib.h"
#endif
-@@ -156,7 +156,7 @@
+@@ -154,7 +154,7 @@ static unsigned long int php_swf_get_bit
}
/* }}} */
-#if defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB)
+#if defined(HAVE_ZLIB)
/* {{{ php_handle_swc */
- static struct gfxinfo *php_handle_swc(php_stream * stream)
+ static struct php_gfxinfo *php_handle_swc(php_stream * stream)
{
-@@ -1454,7 +1454,7 @@
- result = php_handle_swf(stream);
+@@ -1501,7 +1501,7 @@ static void php_getimagesize_from_stream
break;
case IMAGE_FILETYPE_SWC:
+ /* TODO: with the new php_image_register_handler() APIs, this restriction could be solved */
-#if defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB)
+#if defined(HAVE_ZLIB)
result = php_handle_swc(stream);
#else
php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/689b8385d825edc0cdcd0b7a5ca1b6cddba7d06a
More information about the pld-cvs-commit
mailing list