Project

Profile

Help

Bug #3117

closed

Unable to load libsaxoneec. with missing .so extension

Added by Muhammad Rahman about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
High
Category:
PHP API
Start date:
2017-01-26
Due date:
% Done:

100%

Estimated time:
Found in version:
Fixed in version:
1.1.0
Platforms:

Description

Hi,

I am following to install the php saxon in the following manner. I am going to paste the dockerfile to reproduce the bug easily. But unfortunately when I try to test the php code, its keeps on telling me,

"Unable to load /usr/lib64/libsaxoneec.

Error: : Inappropriate ioctl for device

"

Here is my dockerfile. We are going to buy the license but we need to make sure it works for our purpose. Therefore I put the priority to high.


FROM php:5.5-apache

  1. ca-certificates is required to download from github

RUN apt-get -yq update \

&& apt-get install --assume-yes --no-install-recommends \

    tar zip unzip vim ssh git rsync libssl-dev ftp wget \

    php5-dev g++ apache2 gcj-jdk

RUN apt-get install -y libbz2-dev \

&& docker-php-ext-install bz2

WORKDIR /saxonica/

RUN cd /saxonica

RUN wget "http://www.saxonica.com/saxon-c/libsaxon-EEC-setup64-v1.0.2.zip" && unzip libsaxon-EEC-setup64-v1.0.2.zip

RUN yes "" | ./libsaxon-EEC-setup64-v1.0.2

RUN ln -s /usr/lib/ /usr/lib64

RUN ln -s /saxonica/Saxonica/Saxon-EEC1.0.2/libsaxoneec.so /usr/lib/libsaxoneec.so

RUN ln -s /saxonica/Saxonica/Saxon-EEC1.0.2/rt/ /usr/lib/rt

RUN ln -s /saxonica/Saxonica/Saxon-EEC1.0.2/saxon-data/ /usr/lib/saxon-data

RUN export LD_LIBRARY_PATH=/usr/lib/rt/lib/amd64:$LD_LIBRARY_PATH

COPY docker/copy/jetvm.conf /etc/ld.so.conf.d/jetvm.conf

RUN ldconfig

RUN cd Saxonica/Saxon-EEC1.0.2/Saxon.C.API/ && phpize && ./configure --enable-saxon && make && make install

RUN echo extension=saxon.so >> /usr/local/etc/php/conf.d/saxon.ini

RUN php5enmod saxon

RUN echo export LD_LIBRARY_PATH=/usr/lib/rt/lib/amd64:$LD_LIBRARY_PATH >> /etc/apache2/envvars

CMD ["apachectl", "-DFOREGROUND"]

RUN php -m


Thank you very much for your time.


Related issues

Related to SaxonC - Bug #2691: longer custom path to ClosedO'Neil Delpratt2016-03-31

Actions
Actions #1

Updated by O'Neil Delpratt about 7 years ago

Hi,

Is it possible for you to try setting the environment variable SAXONC_HOME=/usr/lib64 or to where you have installed the libsaxoneec.so library.

Actions #2

Updated by Muhammad Rahman about 7 years ago

Hi,

Just did, and the previous error is gone. However now I have other errors.

It was the quickest support I ever received :)

Thanks a lot.

Kind Regards

Muhammad Mostafizur Rahman

Senior Software Engineer

London, UK

+44(0)7782153151

On 26 January 2017 at 16:46, Saxonica Developer Community <

> wrote:

Actions #3

Updated by O'Neil Delpratt about 7 years ago

  • Related to Bug #2691: longer custom path to added
Actions #4

Updated by O'Neil Delpratt about 7 years ago

  • Status changed from New to In Progress

I will open this as a bug because the loading of the library should work without setting the SAXONC_HOME variable.

I will investigate this further. This bug is somewhat similar to #2691

Thank you for your feedback.

Please feel free to submit your other errors if they relate to Saxon/C.

Actions #5

Updated by Muhammad Rahman about 7 years ago

Thank you, I should create another ticket but its related to the same setup.

When running ldconfig it says,

/sbin/ldconfig.real: file /usr/lib/libsaxoneec.so is truncated

The conversion still went correctly. But should we be worried as it will be used commercially?

Actions #6

Updated by O'Neil Delpratt about 7 years ago

Muhammad Rahman wrote:

Thank you, I should create another ticket but its related to the same setup.

When running ldconfig it says,

/sbin/ldconfig.real: file /usr/lib/libsaxoneec.so is truncated

The conversion still went correctly. But should we be worried as it will be used commercially?

No you should not be worried. The library was created using the professional tool: Excelsior Jet

Actions #7

Updated by Muhammad Rahman about 7 years ago

Thanks O'Nell

Our company(affiliate window) uses php7 but your library is in php5.5.

What do you suggest in that case. We can always write our own wrapper around the C library and execute in command line from php.

But that would be better if you can tell us your plan/solution about using it with php 7.

Thanks.

Actions #8

Updated by O'Neil Delpratt about 7 years ago

Hi,

At the moment we are working towards a new major version of Saxon/C which we hope to support PHP7. We never like to give firm dates on releases, but I think it should be in this first quarter of the 2017.

Have you tried building the current Saxon/C against PHP6?

Actions #9

Updated by Muhammad Rahman about 7 years ago

Hi,

Did you mean php 5.6? I am not aware of PHP6, I thought it never existed.

As your timeline seems later than our deadline, it seems we need to execute the c command line from our php 7 library, which is yet to write.

Actions #10

Updated by Muhammad Rahman about 7 years ago

Hi,

Another thought. If we use your php5.5 library for now, how difficult will it be to upgrade to your php7 library? Will you be using the same interface? or we have to recode a lot?

Thanks.

Actions #11

Updated by O'Neil Delpratt about 7 years ago

Have you tried building Saxon/C yourself against PHP7?

Another user tried it. See the bug issue: https://saxonica.plan.io/issues/3084

The bug is still open as some of the errors have not been resolved. But you might be able to resolve them.

We have since been working hard on the next major release for Saxon/C with a redesign of how we interface with PHP. This will in turn support PHP7 and older releases. Therefore we are reluctant to go backwards and patch Saxon/C version 1.0 at this stage to support PHP7 since it was not designed for that version of PHP.

Maybe we can suggest sending you a pre-release of the next Saxon/C product for testing purposes.

Actions #12

Updated by Muhammad Rahman about 7 years ago

Hi O'Nell

We had a little chat and possibly the direction for us is using your C command line tool from our php 7 library.

We will absolutely love to test the pre-release php 7 version of yours. After lunch I am going to build my docker with php 7 and see what issue it raises.

Please do send us the pre-release version. If you need my company email, that will be . Send to whichever you may please.

Thanks.

Actions #13

Updated by Muhammad Rahman about 7 years ago

Hi O'Nell,

We are looking into executing the java and C commnad from php 7 now and bench-marking for the best option. So far java looks good. Transforming 800mb took around 1.32 mins. By the way, I never managed to transfer a 7 gig xml, always memory/times runs out. What would the best practice for that using your tool.

If you can send your pre-release version, that will be best time for us to bench mark that too.

Regards.

Muhammad.

Actions #14

Updated by Michael Kay about 7 years ago

For comparison I've been running transformations on 100Mb (on the Java platform) where my timings are roughly:

Stylesheet compilation - 350ms

Tree building - 1400ms

Stylesheet execution - 100ms

but of course it depends what the stylesheet is actually doing.

To transform 7Gb you'll definitely need to look at XSLT 3.0 streaming transformations - which can be quite easy to write in simple cases, but quite difficult in more complex cases.

Actions #15

Updated by Muhammad Rahman about 7 years ago

Hi MIchael,

Thanks for your prompt reply. I am trying to play around wit streaming, but unfortunately it doesn't recognise the element. Keep saying

unknown xslt element stream

Here is what I am trying, my xml

<?xml version="1.0" encoding="UTF-8"?>

<transactions>

  <transaction value="12.51"/>

  <transaction value="3.99"/>

</transactions>

My xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">

<xsl:template match="/">

<xsl:mode streamable="yes" />

    <xsl:stream href="transactions.xml">

      <count>

        <xsl:value-of select="count(transactions/transaction)"/>

      </count>

    </xsl:stream>

</xsl:template>

</xsl:stylesheet>

And the command I am trying,

java -Xmx4096m -cp ~/Downloads/saxon9ee.jar net.sf.saxon.Transform -t -s:transactions.xml -xsl:transactions.xsl

Hope you can find the error.

Also any news about your php 7 pre-release branch for us to test?

Thanks.

Actions #16

Updated by O'Neil Delpratt about 7 years ago

Saxon/C pre-release still not ready. I will try to send it to you tomorrow.

Actions #17

Updated by Muhammad Rahman about 7 years ago

Hi O'Nell,

Thanks. We probably will go for running c compiler from php as we found it faster that java. But we need the steaming running, as a huge number of xmls are several gigs.

Thanks for your time, please have a look at the above snippets.

Talk to you soon.

Actions #18

Updated by O'Neil Delpratt about 7 years ago

You mention c compiler. Is that with Saxon/C or some thing else?

Actions #19

Updated by O'Neil Delpratt about 7 years ago

In regards to your error message in comment #15 it probably means you are running Saxon without a valid license or in HE mode. Please can you confirm what product you are running. XSLT Streaming requires the Saxon EE edition with a valid license file.

Actions #20

Updated by Muhammad Rahman about 7 years ago

Ah, it make sense now.

OK, I will try with the evaluation license.

Yes, we are using the Saxon/C compiler from php 7.

Actions #21

Updated by O'Neil Delpratt about 7 years ago

Ok great.

Is it possible that you can create new bug entries for issues other than the initial issue raised please. Otherwise it will be difficult to keep track and close the bug entry when fixed.

Thanks

Actions #22

Updated by O'Neil Delpratt over 6 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

I am marking this as resolved as the main issue is now fixed. We have also created a PHP7 extension

Actions #23

Updated by O'Neil Delpratt over 6 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 1.1.0

Bug fix applied in the Saxon/C 1.1.0 major release.

Please register to edit this issue

Also available in: Atom PDF