From 539551c89f4028ed70e5881400fc9151af3d12e8 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 21 May 2021 14:41:35 +0300 Subject: [PATCH] PHP: adopted "file_handle" to Zend API changes in 8.1.0-dev. This fixes building module with the development version of PHP after the change: https://github.com/php/php-src/commit/c732ab400af92c54eee47c487a56009f1d79dd5d --- src/nxt_php_sapi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index 23c148c8..3fb3b0db 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -1101,10 +1101,20 @@ nxt_php_execute(nxt_php_run_ctx_t *ctx, nxt_unit_request_t *r) nxt_memzero(&file_handle, sizeof(file_handle)); file_handle.type = ZEND_HANDLE_FILENAME; +#if (PHP_VERSION_ID >= 80100) + file_handle.filename = zend_string_init((char *) ctx->script_filename.start, + ctx->script_filename.length, 0); + file_handle.primary_script = 1; +#else file_handle.filename = (char *) ctx->script_filename.start; +#endif php_execute_script(&file_handle TSRMLS_CC); +#if (PHP_VERSION_ID >= 80100) + zend_destroy_file_handle(&file_handle); +#endif + /* Prevention of consuming possible unread request body. */ #if (PHP_VERSION_ID < 50600) read_post = sapi_module.read_post;