From 1c394e192dbeeed4acb796e62e88754695566e88 Mon Sep 17 00:00:00 2001 From: "Sergey A. Osokin" Date: Sat, 30 Aug 2025 10:44:40 -0400 Subject: [PATCH] Fix build with php85-beta2 References: - https://wiki.php.net/rfc/remove_disable_classes - https://github.com/php/php-src/pull/12043 CC build/src/nxt_php_sapi-php85.o cc -c -pipe -fPIC -fvisibility=hidden -fno-strict-overflow -funsigned-char -std=gnu11 -O -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fno-strict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -I src -I build/include \ -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DNXT_ZEND_SIGNAL_STARTUP=1 \ -MMD -MF build/src/nxt_php_sapi-php85.dep -MT build/src/nxt_php_sapi-php85.o \ -o build/src/nxt_php_sapi-php85.o src/nxt_php_sapi.c src/nxt_php_sapi.c:714:37: error: no member named 'disable_classes' in 'struct _php_core_globals' 714 | &PG(disable_classes), | ~~~^~~~~~~~~~~~~~~~ /usr/local/include/php/main/php_globals.h:31:30: note: expanded from macro 'PG' 31 | # define PG(v) (core_globals.v) | ~~~~~~~~~~~~ ^ src/nxt_php_sapi.c:715:33: error: use of undeclared identifier 'zend_disable_class' 715 | zend_disable_class); | ^ 2 errors generated. gmake[1]: *** [build/Makefile:2107: build/src/nxt_php_sapi-php85.o] Error 1 --- src/nxt_php_sapi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index c20e074cf..786ab92b7 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -93,8 +93,10 @@ static nxt_int_t nxt_php_alter_option(nxt_str_t *name, nxt_str_t *value, #ifdef NXT_PHP8 static void nxt_php_disable_functions(nxt_str_t *str); #endif +#if (PHP_VERSION_ID < 80500) static void nxt_php_disable(nxt_task_t *task, const char *type, nxt_str_t *value, char **ptr, nxt_php_disable_t disable); +#endif static nxt_int_t nxt_php_dirname(const nxt_str_t *file, nxt_str_t *dir); static void nxt_php_str_trim_trail(nxt_str_t *str, u_char t); @@ -710,9 +712,11 @@ nxt_php_set_options(nxt_task_t *task, nxt_conf_value_t *options, int type) } if (nxt_str_eq(&name, "disable_classes", 15)) { +#if (PHP_VERSION_ID < 80500) nxt_php_disable(task, "class", &value, &PG(disable_classes), zend_disable_class); +#endif continue; } } @@ -817,6 +821,8 @@ nxt_php_disable_functions(nxt_str_t *str) #endif +#if (PHP_VERSION_ID < 80500) + static void nxt_php_disable(nxt_task_t *task, const char *type, nxt_str_t *value, char **ptr, nxt_php_disable_t disable) @@ -868,6 +874,8 @@ nxt_php_disable(nxt_task_t *task, const char *type, nxt_str_t *value, } while (c != '\0'); } +#endif + static nxt_int_t nxt_php_dirname(const nxt_str_t *file, nxt_str_t *dir)