0

I need to use XSLT 2.0 with PHP on Windows for a work, and after a few research, it seems that the best way to achieve it is to use the saxon-C of Saxonica.

I followed the official documentation until this point :

The PHP extension has not yet been built. It can be built using the PHP source. [...] To build the PHP extension yourself please see the Saxon-C-API Visual Studio 2008 project included in the installation (e.g. 'C:\Program Files\Saxonica\SaxonHEC1.1.0\Saxon-C-API').

I looked at the file and there are some .h and .cpp files and the config.w32 file, so I tried to build the extension according to this documentation :

http://blog.benoitblanchon.fr/build-php-extension-on-windows/

But I have some error during the process.

Is it the right way to perform it ? Or is there a better way to do it ?

Sorry if the answer is obvious, I'm not a PHP pro.

Thank you in advance for your answer.

6
  • Hi, Thanks for your post. We would like to assist you in getting Saxon/C PHP extension working on windows. Please can you add the errors you are seeing? Also what version of PHP are you using?
    – ond1
    Feb 28, 2018 at 13:12
  • I have created the following bug issue to keep track of progress of the PHP extension of Saxon/C on Windows: saxonica.plan.io/issues/3705
    – ond1
    Feb 28, 2018 at 14:46
  • Hi, Thank you for your answer! I'm using PHP 7.0.27. When I try to build the extension, I add the modules with the command line "--add-modules-dir-dir=C:\path\to\the\saxon.C.API\folder", it seems to work but after I can't enable the saxon extension with "--enable-saxon" or "--with-saxon" because it don't appear as a valid option ("unknow option --enable-saxon; please try configuer.js --help for a list of valid option"). I hope that I succed to be clear. Again thank you for your help!
    – Rossant
    Feb 28, 2018 at 16:23
  • For PHP 7.0.27 the following guide might be more helpful: wiki.php.net/internals/windows/stepbystepbuild I tried building with PHP 7.2 using the following guide: wiki.php.net/internals/windows/stepbystepbuild_sdk_2 This guide led me to use the github page: github.com/Microsoft/php-sdk-binary-tools which got me further in the build process. Getting some build errors in the C++ code.
    – ond1
    Mar 2, 2018 at 15:08
  • Updated saxonica.plan.io/issues/3705
    – ond1
    Mar 2, 2018 at 15:24

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.