I've build the Saxon/C PHP extension in a PHP-FPM docker image. The current extension name is ext-saxon/c
, while PhpStorm
and composer
expect the extension name to be ext-saxonc
. Is it possible to change/override that in either the Saxon build process or in PhpStorm?
When I use the code in PhpStorm, I get the following error:
To make PhpStorm aware of the Saxon extension, I have to manually enable it in the PHP Runtime settings, because it is not recognized automatically by the interpreter:
But now, I get the message that the ext-saxonc
PHP extension is missing from my composer.json
file.
In my composer.json
file, I can do the following:
"require": {
"ext-saxon/c": "*",
}
But I cannot do the below, because that extension is not recognized as installed.
"require": {
"ext-saxonc": "*",
}
My docker code to build the extension:
FROM php:7.4.5-fpm
ARG saxon='libsaxon-HEC-setup64-v1.2.1'
RUN set -eux; \
apt-get update && apt-get install -y --no-install-recommends wget; \
cd /tmp && wget --quiet https://www.saxonica.com/saxon-c/${saxon}.zip; \
unzip ${saxon}.zip; \
./${saxon} -batch -dest /tmp/saxon; \
cp /tmp/saxon/libsaxonhec.so /usr/lib/; \
cp -r /tmp/saxon/rt /usr/lib; \
ldconfig; \
cd /tmp/saxon/Saxon.C.API/; \
phpize; \
./configure --enable-saxon; \
make -j$(nproc); \
make install; \
docker-php-ext-enable saxon; \
rm -rf /tmp/${saxon} /tmp/${saxon}.zip /tmp/saxon /var/lib/apt/lists/*;