2

I am trying to install the Saxon-C XSLT-parser with it's PHP module on my server as explained here: http://www.saxonica.com/saxon-c/index.xml. I successfully installed it and compiled the PHP module. Maybe someone of you might have an idea, whats going wrong.

When starting apache I get the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/saxon.so' - 
libsaxon.so: cannot open shared object file: No such file or directory in Unknown on line 0

I know that it is searching the LD library.

more /etc/ld.so.conf.d/jetvm.conf
/opt/saxon/rt/lib/amd64
/opt/saxon/rt/lib/amd64/jetvm

tail -n 1 /etc/apache2/envvars
export LD_LIBRARY_PATH=/opt/saxon/rt/lib/amd64:/opt/saxon/rt/lib/amd64/jetvm:$LD_LIBRARY_PATH

echo $LD_LIBRARY_PATH
/opt/saxon/rt/lib/amd64:/opt/saxon/rt/lib/amd64/jetvm/

Everything seems to be right. I also double checked that all Paths are existing.

I have already checked the following threads (and much more), which couldn't help me:

After trying a couple of hours without any progress I really hope, someone can help me here. Maybe the solution is quite dump. I have not much experience with languages which has to be compiled, therefore I can only understand vaguely what is going on here.

Have many thanks in advance and best wishes.

Community
  • 1
  • 1
Paflow
  • 2,030
  • 3
  • 30
  • 50

3 Answers3

1

The troubleshooting guide provides some hints to this problem:

Run the following command should resolve the error: "$ sudo ldconfig". Alternatively create a symlink to java virtual machine. This is not required to install/compile, but it is required for PHP code. The following should resolve the issue on a 64-bit machine:

ln -s $JAVA_HOME/jre/lib/amd64/server/libjvm.so /lib64/libjvm.so

Alternatively, it is possible to link the libjvm.so from the rt/lib/jetjvm directory.

ond1
  • 691
  • 6
  • 10
  • Note: Your paths to the JVM or are probably different to my description – ond1 Oct 07 '15 at 10:06
  • Thank you for your will to help, but I knew the section from that troubleshooting you are citing, it's the same page I mentioned above and it's they are talk about a different error that I get. Besides, I tried both things nevertheless, but it did't help :( – Paflow Oct 12 '15 at 13:36
  • 1
    Did you put the libsaxon.so under the directory '/usr/lib'? I think this could be the problem. In the 0.3.1 release the location of the libsaxon.so is hard coded to that location. We have changed to use a environment variable in the next release. – ond1 Oct 13 '15 at 08:25
  • Good to know that, I put it under /usr/lib64 and /usr/local/lib. Thank you! After making a symbolic link to /usr/lib the php module now gets loaded. But unfortunately when I want to instantiate the SaxonProcessor I get a segmentation fault without any further information... – Paflow Oct 13 '15 at 10:01
  • Please can you post the code. Also post the error from the log file which should show up what is going wrong. – ond1 Oct 13 '15 at 10:09
  • The error said nothing except that the process with pid xxx was stopped because of segmentation fault. But I found a solution now; apparently it was not enough to make some symbolic links; I had to reinstall the whole thing so /usr/lib and compile it from there. Maybe you should put this to the installation page. Thank you for your help in any way; I would never figured that out without that. I made a new answer for other users to find the solution faster. – Paflow Oct 13 '15 at 10:17
0

The libsaxon.so file must be installed within the /usr/lib directory. We are making steps in the next release to use an environment variable.

ond1
  • 691
  • 6
  • 10
0

With the friendly aid of ond1, who is one of the developers of the Saxon, I finally found a solution. Apparently there are some Paths hardcoded so, you have to ignore the installer's question where to put the files and install it to /usr/lib.

I Uninstalled previous installation, installed to /usr/lib and coompiled from there - and now it works.

Paflow
  • 2,030
  • 3
  • 30
  • 50