summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unit-php.spec10
-rw-r--r--unit-php82.patch42
2 files changed, 51 insertions, 1 deletions
diff --git a/unit-php.spec b/unit-php.spec
index 4d64bcd..11604d3 100644
--- a/unit-php.spec
+++ b/unit-php.spec
@@ -35,13 +35,16 @@ Requires: %{scl_prefix}php-embedded
Name: %{?scl_prefix}%{project}-php
Version: 1.27.0
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: PHP module for NGINX Unit
License: ASL 2.0
URL: https://unit.nginx.org/
Source0: https://github.com/%{gh_owner}/%{project}/archive/%{gh_commit}/%{project}-%{version}-%{gh_short}.tar.gz
+# https://github.com/nginx/unit/pull/713
+Patch0: %{project}-php82.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
@@ -62,6 +65,7 @@ and NGINX unit %{version}.
%prep
%setup -qn %{project}-%{gh_commit}
+%patch0 -p1
%build
@@ -122,6 +126,10 @@ make %{modname}-install DESTDIR=%{buildroot}
%changelog
+* Thu Jun 2 2022 Remi Collet <remi@remirepo.net> - 1.27.0-2
+- fix build with PHP 8.2 using patch from
+ https://github.com/nginx/unit/pull/713
+
* Thu Jun 2 2022 Remi Collet <remi@remirepo.net> - 1.27.0-1
- update to 1.27.0
diff --git a/unit-php82.patch b/unit-php82.patch
new file mode 100644
index 0000000..abcfcf2
--- /dev/null
+++ b/unit-php82.patch
@@ -0,0 +1,42 @@
+From e90451adbe213803ef5f456e7715a2a79d83dccd Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 2 Jun 2022 16:16:35 +0200
+Subject: [PATCH] fix php_module_startup call for PHP 8.2
+
+---
+ auto/modules/php | 4 ++++
+ src/nxt_php_sapi.c | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/auto/modules/php b/auto/modules/php
+index e92a67cd3..328cd8df2 100644
+--- a/auto/modules/php
++++ b/auto/modules/php
+@@ -149,7 +149,11 @@ nxt_feature_test="
+ #include <php_main.h>
+
+ int main() {
++ #if PHP_VERSION_ID < 80200
+ php_module_startup(NULL, NULL, 0);
++ #else
++ php_module_startup(NULL, NULL);
++ #endif
+ return 0;
+ }"
+
+diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c
+index 68ef07eb1..dda3c1f21 100644
+--- a/src/nxt_php_sapi.c
++++ b/src/nxt_php_sapi.c
+@@ -1150,7 +1150,11 @@ nxt_php_vcwd_chdir(nxt_unit_request_info_t *req, u_char *dir)
+ static int
+ nxt_php_startup(sapi_module_struct *sapi_module)
+ {
++#if PHP_VERSION_ID < 80200
+ return php_module_startup(sapi_module, &nxt_php_unit_module, 1);
++#else
++ return php_module_startup(sapi_module, &nxt_php_unit_module);
++#endif
+ }
+
+