https://github.com/unbit/uwsgi/commit/6fba62a3ad947b656bb4379f8f903e90c7b01346 From 6fba62a3ad947b656bb4379f8f903e90c7b01346 Mon Sep 17 00:00:00 2001 From: Alexandre Rossi Date: Tue, 10 Jan 2023 10:01:05 +0000 Subject: [PATCH] plugins/php: fix build with PHP >= 8.2 from https://raw.githubusercontent.com/php/php-src/PHP-8.2/UPGRADING.INTERNALS: ======================== 5. SAPI changes ======================== * The signature of php_module_startup() has changed from int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint32_t num_additional_modules) to zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_module) as only one additional module was ever provided. --- plugins/php/php_plugin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c index 9bb8befad..4d3930b82 100644 --- a/plugins/php/php_plugin.c +++ b/plugins/php/php_plugin.c @@ -607,7 +607,11 @@ static void activate_user_config(const char *filename, const char *doc_root, siz static int php_uwsgi_startup(sapi_module_struct *sapi_module) { +#if ((PHP_MAJOR_VERSION >= 8) && (PHP_MINOR_VERSION >= 2)) + if (php_module_startup(&uwsgi_sapi_module, &uwsgi_module_entry)==FAILURE) { +#else if (php_module_startup(&uwsgi_sapi_module, &uwsgi_module_entry, 1)==FAILURE) { +#endif return FAILURE; } else { return SUCCESS;