Update on Saxon/C PHP extension for Windows:

I have finally managed to get the extension to load within PHP, which now shows up when I run the code phpinfo().

However, when I execute the php code 'new XSLTProcessor()' it is not working. I am currently in debugging  phase, I am hoping that it is just a setup problem with finding the Saxon/C dll library.

Kind regards,
O'Neil

On 09/12/2013 10:57, Dr O'Neil Delpratt wrote:
Got a bit further on windows. Managed to get around the error : 'Invalid Library (maybe not a PHP library)'
I had to removed a predirective which is for linux only. This was around the code:

ZEND_GET_MODULE(saxon)

Library still not loading properly though when I run phpinfo(). Currently investigating it.

On 09/12/2013 09:52, Dr O'Neil Delpratt wrote:
Just to inform the mailing list on the progress on the Saxon/C  - PHP extension for Windows: see email correspondance below.
 BTW. I am currently investigating PHP library load error specified below.


---------- Forwarded message ----------
From: Lauro Campos <laur0@hotmail.com>
Date: Sat, Dec 7, 2013 at 12:25 AM
Subject: RE: [saxon] Saxon/C question UPDATE
To: O'Neil Delpratt <davion7@gmail.com>


Hello again,

So I tried adding the extension to php, at first, I got an error saying "php_saxon.dll was not a valid win 32...", I remembered I had wamp 64 bit, so I removed that installation and installed 32 bit, and now I get an error saying:

"PHP Startup: Invalid Library (maybe not a PHP library) 'php_saxon.dll'"

And I'm positive I have 32 bit Saxon/C since it is installed under Program Files(x86), when I installed 64 bit it installed under regular Program Files directory.

I tried copying libsaxon.dll everywhere in the php folder with no success.

I went and googled the error and found this on stackoverflow:


There is just one answer saying:

This message means there's no "get_module" function in the ".so".
Make sure the PHP extension source contains the lines:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

and

#ifdef COMPILE_DL_MYLIB
ZEND_GET_MODULE(mylib)

I'm using WAMP server 2.4, which comes with Apache 2.4.4 and PHP 5.4.16.

I'm trying to cover every possible error on my side and be as descriptive as I can. Hope you find this helpful and let me know what else I can do to help you.

Best Regards,

Lauro Campos


Date: Fri, 6 Dec 2013 20:46:21 +0000
Subject: RE: [saxon] Saxon/C question
From: davion7@gmail.com
To: laur0@hotmail.com

Yes I do mean libsaxon.dll. 32-bit

Hello O'Neil,

I'll give it a try in a couple of hours, by saxon.dll I guess you mean libsaxon.dll, should I use 32 bits or 64 bits? And do I need it only installed? Or should I move it to some specific folder? I'm gonna try it using wamp also, I hoping for the best.

Best Regards,

Lauro Campos


Date: Fri, 6 Dec 2013 16:34:43 +0000
From: oneil@saxonica.com
To: laur0@hotmail.com
CC: mike@saxonica.com
Subject: Re: [saxon] Saxon/C question

Hi Laruo,

I have managed to build the php library using Visual studio 2008 from the source files in the download file, but I having trouble loading the extension on my PHP server. I am using wamp. I am attaching the php_saxon.dll file as zip to see if you have better joy than me. Please let me know if it works for you.

You still need the saxon.dll file, which you already have I believe.
You also need to add the following line in the php.ini file:

    extension=php_saxon.dll

You need to install the php library i nthe usual place of your PHP extension libraries.

Kind regards,
O'Neil

On 05/12/2013 23:50, Lauro Campos wrote:
Great!

Thanks a lot for quick response O'Neil, I'll be waiting for the guide, and I'll be glad to provide feedback as soon as I can provide some more.

Best Regards,

Lauro Campos


Date: Thu, 5 Dec 2013 23:26:23 +0000
From: oneil@saxonica.com
To: saxon-help@lists.sourceforge.net; laur0@hotmail.com
Subject: Re: [saxon] Saxon/C question

Hi Lauro,

Thanks for getting in touch with use in regards to Saxon/C. Your feedback is appreciated.

As assumed the installation steps are for Linux. The windows executables does include the Saxon/C DLLs, but I have not tried building the PHP extension on the Windows platform or provided steps as yet. It is on my to-do list, which I will now make it top priority. I should be able to provide a guide for Windows, hopefully by tomorrow.

Kind regards,

O'Neil

On 05/12/13 01:17, Lauro Campos wrote:
Hello,

I recently asked a question on stack over flow, What is the best way to use XSLT 2.0 with PHP? , and got answered by Michael Kay and suggested using Saxon/C  eventhough it is on alpha release, so I checked out the site, and it seems that this is exactly what I'm looking for, being able to do this: 

<?php 
        $saxon_version = $xslt->version();
        $xslt = new XsltProcessor();
        echo $xslt->xsltApplyStylesheet("cat.xml", "test.xsl");
    ?>

Using XSLT 2.0 seems like a dream, but there are no instructions on how to use it on Windows, I download the installers, both 32 and 64 bits versions, installed them separatedly, checked them out and the instructions on these are the same that are on the site and they are for Linux apparently. 

What I am asking here is for directions on how to use this on PHP on windows, I tried following the instructions to install the extension:

PHP extension:

To build the php extension follow the steps below:

  • Uncomment the following code in the file xsltProcessor: #include "php_saxon.h"

Run the commands:

  • phpize
  • ./configure --enable-saxon
  • make
  • sudo make install

Update the php.ini file (if using Ubuntu it is usually in the location '/etc/php5/apache2/') to contain the php extension. Insert the following in the Dynamic Extensions section: extension=saxon.so

Without success.
Any help would be greatly appreciated.

Best Regards,
Lauro Campos


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 


--
O'Neil Delpratt
Software Developer, Saxonica Limited
Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community Site: http://dev.saxonica.com Saxonica Bug tracking System: https://saxonica.plan.io/

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4259 / Virus Database: 3658/6895 - Release Date: 12/05/13



No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4259 / Virus Database: 3658/6902 - Release Date: 12/08/13





------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4259 / Virus Database: 3658/6902 - Release Date: 12/08/13