compiling PHP extension fails
Hi, I am trying to compile the libsaxon-11.4 PHP extension on a CentOS machine with gcc 11.2.1 20210728 (Red Hat 11.2.1-1). Following the steps on https://www.saxonica.com/saxon-c/doc1.1/html/index.html#Installation the make script fails with the following errors:
/libsaxon-HEC-11.4/Saxon.C.API/php7_Xslt30Processor.cpp:418:73: error: 'TSRMLS_C' was not declared in this scope; did you mean 'TSRM_H'? 418 | zend_throw_exception(zend_exception_get_default(TSRMLS_C), exception->getMessage(), 0 TSRMLS_CC) | ~ ^~~~~~~~~~ /libsaxon-HEC-11.4/Saxon.C.API/php7_Xslt30Processor.cpp:418:110: error: expected ')' before 'TSRMLS_CC' 418 | zend_throw_exception(zend_exception_get_default(TSRMLS_C), exception->getMessage(), 0 TSRMLS_CC); | ~ ^~~~~~~~~~ /libsaxon-HEC-11.4/Saxon.C.API/php7_Xslt30Processor.cpp:542:77: error: 'ZEND_ACC_DTOR' was not declared in this scope; did you mean 'ZEND_ACC_CTO '? 542 | PHP_ME(Xslt30Processor, __destruct, nullptr, ZEND_ACC_PUBLIC | ZEND_ACC_DTOR) | ^~~~~~~~~~~~~
The compilation process fails permanently. How can I get rid of these errors? I'd very much appreciate to get some input pointing me to the right direction. Thank you! --franz
Updated by franz kelnreiter 10 months ago
mybe I forgot an important information. The php running on the host is:
PHP 8.1.3 (cli) (built: Feb 16 2022 01:00:24) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.1.3, Copyright (c) Zend Technologies with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
Updated by O'Neil Delpratt 10 months ago
Hi, there is a bug issue against SaxonC 11 for PHP 8. Details and patch are given in the bug issue #4842.
You will need to download the zip file mentioned here: https://saxonica.plan.io/issues/4842#note-24
The zip file contains all the files needed for the PHP8 patch. Copy the files in the Saxon.C.API directory. Notice here we replace the config.m4 file.
For this PHP8 patch, the XSLT user-defined extension for PHP does not work. I am still investigating a solution for this, but it should affect you.
Please test it and let me know how it goes.
Please register to edit this issue