diff --git a/uwsgi.spec b/uwsgi.spec index 150b288..0cc77f1 100644 --- a/uwsgi.spec +++ b/uwsgi.spec @@ -187,7 +187,7 @@ Name: uwsgi Version: 2.0.20 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Fast, self-healing, application container server # uwsgi is licensed under GPLv2 with a linking exception # docs are licensed under MIT @@ -217,6 +217,8 @@ Patch13: uwsgi_fix_chroot_chdir.patch Patch14: uwsgi_fix_php_arginfo.patch Patch15: uwsgi_fix_python_py_ssize_t.patch Patch16: uwsgi_python311.patch +# https://github.com/unbit/uwsgi/pull/2400 +Patch17: uwsgi_fix_php81_filename_zend_string.patch BuildRequires: curl, libxml2-devel, libuuid-devel, jansson-devel BuildRequires: libyaml-devel, ruby-devel @@ -1241,6 +1243,7 @@ cp -p %{SOURCE5} README.Fedora %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 %if %{with perl} && (%{with python3} || %{with python3_other}) && %{with perlcoro} %{__python} -m lib2to3 --write --nobackups plugins/coroae/uwsgiplugin.py @@ -1835,6 +1838,9 @@ exit 0 %changelog +* Tue Aug 09 2022 Ralf Ertzinger - 2.0.20-9 +- Fix PHP 8.1 support + * Sat Jul 23 2022 Fedora Release Engineering - 2.0.20-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/uwsgi_fix_php81_filename_zend_string.patch b/uwsgi_fix_php81_filename_zend_string.patch new file mode 100644 index 0000000..81d9025 --- /dev/null +++ b/uwsgi_fix_php81_filename_zend_string.patch @@ -0,0 +1,42 @@ +From 8ca18da9a01eee19156243c5c0d28d2572698e4a Mon Sep 17 00:00:00 2001 +From: Riccardo Magliocchetti +Date: Sun, 30 Jan 2022 14:31:50 +0100 +Subject: [PATCH] plugins/php: handle php8.1 zend_file_handle signature change + +filename is now a zend_string. + +Refs #2394 +--- + plugins/php/php_plugin.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c +index d336adddc..8b5a24156 100644 +--- a/plugins/php/php_plugin.c ++++ b/plugins/php/php_plugin.c +@@ -1096,14 +1096,19 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) { + + SG(request_info).path_translated = wsgi_req->file; + +- memset(&file_handle, 0, sizeof(zend_file_handle)); +- file_handle.type = ZEND_HANDLE_FILENAME; +- file_handle.filename = real_filename; ++#if PHP_VERSION_ID >= 80100 ++ zend_string *handle_filename = zend_string_init(real_filename, real_filename_len, 0); ++#else ++ const char *handle_filename = real_filename; ++#endif ++ memset(&file_handle, 0, sizeof(zend_file_handle)); ++ file_handle.type = ZEND_HANDLE_FILENAME; ++ file_handle.filename = handle_filename; + +- if (php_request_startup() == FAILURE) { ++ if (php_request_startup() == FAILURE) { + uwsgi_500(wsgi_req); +- return -1; +- } ++ return -1; ++ } + + struct uwsgi_string_list *usl=NULL; +