Project

Profile

Help

How to connect?
Download (25.3 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.9 / hec / saxonc-doc / doc / starting.xml @ 8bb58fad

1
<?xml version="1.0" encoding="UTF-8"?>
2
<article id="starting" title="Getting Started">
3
   <h1>Getting Started</h1>
4

    
5
   <p>This section of the documentation describes how to get hold of Saxon/C and the PHP and Python
6
      extensions, how to install on the different platforms, and how to get started using it.</p>
7

    
8
   <nav>
9
      <ul/>
10
   </nav>
11

    
12
   <p>Please use the help forums ("Forums") and bug trackers ("Issues") in the <a target="_blank"
13
         href="https://saxonica.plan.io/projects/saxon-c">Saxon/C project</a> at the Saxonica
14
      community site if you need help or advice, or want to provide any other feedback.</p>
15

    
16

    
17
   <section id="installing" title="Installing Saxon/C">
18
      <h1>Installing Saxon/C</h1>
19

    
20
      <p>Saxon/C can be installed on Linux, Mac OS and Windows. In this section we provide a step by
21
         step installation guide for the three platforms.</p>
22

    
23
      <nav>
24
         <ul/>
25
      </nav>
26

    
27
      <p>For information on installing the PHP and Python extensions see the <a
28
            href="/starting/installingphp">PHP Extension</a> and <a
29
            href="/starting/installingpython">Python Extension</a> sections.</p>
30

    
31
      <section id="installingLinux" title="Linux">
32
         <h1>Installing on Linux</h1>
33

    
34
         <aside>In the following, [EDITION] means one of: HE, PE, EE; and [VERSION] is the
35
            maintenance release version number (for instance 1.2.1). </aside>
36

    
37
         <ol>
38
            <li>
39
               <p>To install the Saxon-[EDITION]/C release, first unzip the file
40
                     <code>libsaxon-[EDITION]C-setupv[VERSION].zip</code> and execute the
41
                  command:</p>
42
               <kbd>./libsaxon-[EDITION]C-setup-v[VERSION]</kbd>
43
            </li>
44

    
45
            <li>
46
               <p>The next step is to select the destination where the product files will be
47
                  installed. The product files are unpacked in the <code>Saxon-[EDITION]C</code>
48
                  directory.</p>
49

    
50
               <kbd>cd Saxonica/Saxon-[EDITION]C[VERSION]/</kbd>
51
               <kbd>sudo cp libsaxon[EDITION].so /usr/lib/.</kbd>
52

    
53
               <p>Alternatively you can create a symbolic link to where the saxon library is
54
                  installed so it can be found. For example:</p>
55

    
56
               <kbd>ln -s path/Saxonica/Saxon-[EDITION]C[VERSION]/libsaxon[EDITION].so
57
                  /usr/lib/libsaxon[EDITION].so</kbd>
58
            </li>
59

    
60
            <li>
61
               <p>You need to set up the environment for the JET JVM. The JVM is in the
62
                     <code>Saxonica/Saxon-[EDITION]C[VERSION]/rt</code> directory.</p>
63

    
64
               <kbd>sudo cp -r rt /usr/lib/.</kbd>
65

    
66
               <p>Alternatively you can create a symbolic link to the JetVM library so it can be
67
                  found. For example:</p>
68

    
69
               <kbd>ln -s path/Saxonica/Saxon-[EDITION]C[VERSION]/rt /usr/lib/rt</kbd>
70
            </li>
71

    
72
            <li>
73
               <p>Set the JET-home environment accordingly to where it is installed, e.g.
74
                     <code>JET-home=/usr/lib/Saxon-[EDITION]C[VERSION]/rt</code>. The directory
75
                     <code>JET-home/lib/amd64</code> must be listed in the
76
                     <code>LD_LIBRARY_PATH</code> environment variable. For instance, if you are
77
                  using a bash or Bourne shell, use the following command:</p>
78

    
79
               <kbd style="word-wrap: break-word;">export
80
                  LD_LIBRARY_PATH=/usr/lib/rt/lib/amd64:/usr/lib/rt/lib/amd64/jetvm:$LD_LIBRARY_PATH</kbd>
81

    
82
               <p>So, for Ubuntu, you can create a file <code>/etc/ld.so.conf.d/jetvm.conf</code>
83
                  with content:</p>
84

    
85
               <samp><![CDATA[# JetVM env path (required for Saxon)
86
      /usr/lib/rt/lib/amd64
87
      /usr/lib/rt/lib/amd64/jetvm]]></samp>
88

    
89
               <p>Next run: </p>
90
               <kbd>sudo ldconfig</kbd>
91
               <p>Ignore the message 'file /lib/libsaxon[EDITION].so is truncated'. The library was created using
92
               Excelsior Jet. The library is loaded from within the Saxon/C application and not in the usual way of shared libraries.</p>
93
            </li>
94

    
95
            <!-- <li><p>The C++ compiler requires the include path to the Java header files during compilation.
96
            We now distribute the jni header files with the C++ code. So this
97
            In most cases this is achieved simply by installing gcj-jdk. Alternatively, according to
98
            http://www.network-theory.co.uk/docs/gccintro/gccintro_23.html, add the Java header file
99
            dirs in the JAVA_HOME directory to this environment variable used by the compiler. For
100
            example:</p>
101

102
         <kbd style="word-wrap: break-word;"
103
            >CPLUS_INCLUDE_PATH=/usr/lib/rt/amd64:$JAVA_HOME/include/linux:$JAVA_HOME/include <br/>
104
            export CPLUS_INCLUDE_PATH</kbd>   </li> -->
105

    
106
            <li>
107
               <p>You must also copy the <code>saxon-data</code> directory into the same directory
108
                  as the <code>libsaxon[EDITION].so</code>.</p>
109
            </li>
110
         </ol>
111

    
112
         <p>Saxon/C is now installed, and ready to run. Please see <a href="../running">Running
113
               Saxon/C</a> to get started. Note that the commercial products Saxon-PE/C and
114
            Saxon-EE/C require a license, so you may also need to refer to <a href="../licensing"
115
               >Licensing</a> for details about how to get this set up.</p>
116

    
117
      </section>
118

    
119

    
120
      <section id="installingMac" title="Mac OS">
121
         <h1>Installing on Mac OS</h1>
122

    
123
         <aside>In the following, [EDITION] means one of: HE, PE, EE; and [VERSION] is the
124
            maintenance release version number (for instance 1.2.1). </aside>
125

    
126
         <ol>
127
            <li>
128
               <p>To install any of the Saxon/C releases on the Mac OS system, first unzip the
129
                  self-contained file <code>libsaxon-[EDITION]-mac-setup-v[VERSION].zip</code>.</p>
130
            </li>
131

    
132
            <li>
133
               <p>The next step is to copy the <code>libsaxon[EDITION].dylib</code> library and the
134
                     <code>rt</code> directories to your install location. The C/C++ interface by
135
                  default assumes the library files and directories are installed in the
136
                     <code>/usr/local/lib</code> directory. The location of the Saxon/C library can
137
                  be set using the <code>SAXONC_HOME</code> environment variable. The privileges of
138
                  the folders and files may need adjusting after copying everything if you encounter
139
                  permission issues. Use for instance the following commands:</p>
140

    
141
               <kbd>cd libsaxon-HEC-mac-setup-v[VERSION]/</kbd>
142
               <kbd>sudo cp libsaxonhec.dylib /usr/local/lib/.</kbd>
143
               <kbd>sudo cp -r rt /usr/local/lib/.</kbd>
144
            </li>
145

    
146
            <li>
147
               <p>The <code>DYLD_LIBRARY_PATH</code> environment variable must be set as
148
                  follows:</p>
149

    
150
               <kbd>export JET_HOME=/usr/local/lib/rt</kbd>
151
               <kbd>export DYLD_LIBRARY_PATH=$JET_HOME/lib/jetvm:$DYLD_LIBRARY_PATH</kbd>
152
            </li>
153
         </ol>
154

    
155
         <p>Saxon/C is now installed, and ready to run. Please see <a href="../running">Running
156
               Saxon/C</a> to get started. Note that the commercial products Saxon-PE/C and
157
            Saxon-EE/C require a license, so you may also need to refer to <a href="../licensing"
158
               >Licensing</a> for details about how to get this set up.</p>
159

    
160
      </section>
161

    
162
      <section id="installingWindows" title="Windows">
163
         <h1>Installing on Windows</h1>
164

    
165
         <aside>In the following, [EDITION] means one of: HE, PE, EE; and [VERSION] is the
166
            maintenance release version number (for instance 1.2.1). </aside>
167

    
168
         <ol>
169
            <li>
170
               <p>To install the Saxon-[EDITION]/C release, first run the executable
171
                     <code>libsaxon-[EDITION]-win-setup.exe</code>. </p>
172
            </li>
173

    
174
            <li>
175
               <p>The next step is to select the destination where the product files will be
176
                  installed - the default and recommended location is <code>C:\Program
177
                     Files\Saxonica\Saxon[EDITION][VERSION]</code>. This is the location that the
178
                  PHP extension looks for the Saxon/C DLL library, so we advise using this default
179
                  location. </p>
180
            </li>
181
         </ol>
182

    
183
         <p>Saxon/C is now installed, and ready to run. Please see <a href="../running">Running
184
               Saxon/C</a> to get started. Note that the commercial products Saxon-PE/C and
185
            Saxon-EE/C require a license, so you may also need to refer to <a href="../licensing"
186
               >Licensing</a> for details about how to get this set up.</p>
187

    
188

    
189
      </section>
190

    
191

    
192
   </section>
193

    
194
   <section id="licensing" title="Licensing">
195
      <h1>Licensing</h1>
196

    
197
      <h2 class="subtitle">Saxon-PE/C and Saxon-EE/C</h2>
198

    
199
      <p>Saxon-PE/C and Saxon-EE/C are commercial products, and require a license key. By
200
         downloading the software, you agree to the terms and conditions published at <a
201
            target="_blank" href="https://saxonica.com/license/eval-license.pdf"
202
            >https://saxonica.com/license/eval-license.pdf</a> (for use with a free <a
203
            target="_blank" href="https://saxonica.com/download/download.xml">evaluation
204
         license</a>) or <a target="_blank" href="https://saxonica.com/license/paid-license.pdf"
205
            >https://saxonica.com/license/paid-license.pdf</a> (in the case of paid-up licenses,
206
         purchased from our <a target="_blank" href="https://saxonica.com/shop/shop.html">online
207
            store</a>).</p>
208

    
209
      <h3>Location of the Saxon license file</h3>
210

    
211
      <p>Saxon/C looks in the path relative to where the main library has been installed. For
212
         example, in <code>/usr/lib</code> if this is where <code>libsaxon[EDITION]c.so</code> has
213
         been installed. Alternatively, Saxon also looks for the license according to the
214
         environment variable <code>SAXONC_HOME</code>, if this has been set.</p>
215
      <!--<p>The license file can also be placed in the same directory as the stylesheet, but we advise
216
         against this for PHP servers where the license might be compromised.</p>-->
217

    
218
      <p>Alternatively the <code>licenseFileLocation</code> configuration property can be used to
219
         provide the license location (see <a href="/configuration">Configuration</a> for more
220
         details about setting configuration features). For example, to provide the
221
            <code>licenseFileLocation</code> in PHP:</p>
222
      <samp><![CDATA[$saxonProc = new Saxon\SaxonProcessor(true);
223
$saxonProc->setConfigurationProperty("http://saxon.sf.net/feature/licenseFileLocation", "/usr/lib/saxon-license.lic");]]></samp>
224

    
225
      <h2 class="subtitle">Saxon-HE/C</h2>
226

    
227
      <p>Saxon-HE/C is an open-source product. The primary license is the <a target="_blank"
228
            href="https://www.mozilla.org/MPL/2.0/">Mozilla Public License version 2.0</a>. In most
229
         cases, the source files are marked as being "incompatible with secondary licenses", which
230
         means that the code cannot be combined with code issued under a GPL license (the reason for
231
         this is the difficulty of contacting all past contributors to gain their assent).</p>
232

    
233
      <p>Some components are licensed under the Apache version 2.0 license or under BSD-style
234
         licenses. For more information see the <a href="https://saxonica.com/license/license.xml"
235
            target="_blank">Licenses</a> section on the main Saxonica website.</p>
236

    
237
      <p>Although Saxon/C technically adheres to the definition of open source software, there are
238
         practical limitations. Specifically, the "Source Code Form" of the product, in the
239
         terminology of the MPL license, consists primarily of Java source code, and in order to
240
         build Saxon/C from the Java source code, you need access to the Excelsor JET development
241
         tools, which are no longer commercially available to new users.</p>
242

    
243

    
244
   </section>
245

    
246
   <section id="running" title="Running Saxon/C">
247
      <h1>Running Saxon/C</h1>
248

    
249
      <p>To check that Saxon/C is correctly installed (having followed the revelant instructions
250
         from <a href="../installing">Installing Saxon/C</a>, including getting the Saxon license
251
         location set up as required for Saxon-PE/C or Saxon-EE/C, as described in <a
252
            href="../licensing">Licensing</a>), you can try running some of the provided samples. </p>
253

    
254
      <p>For example, to run the C++ <code>testXPath</code> sample file on Linux or Mac OS use the
255
         following commands (where [PLATFORM] is linux or mac):</p>
256

    
257
      <kbd>cd samples/cppTests/</kbd>
258
      <kbd>./build64-[PLATFORM].sh</kbd>
259
      <kbd>./testXPath</kbd>
260

    
261
      <p>Similarly for Windows, use the commands:</p>
262

    
263
      <kbd>cd samples/cppTests/</kbd>
264
      <kbd>buildCPPSaxon[EDITION].bat</kbd>
265
      <kbd>testXPath.exe</kbd>
266

    
267
      <p>The <code>samples/cppTest</code> directory provides many more examples in C/C++ which can
268
         be run. For more information about these samples see <a href="/samples/samples_c"
269
            >Samples</a>.</p>
270

    
271

    
272
      <h2 class="subtitle">Using Saxon/C in applications</h2>
273

    
274
      <p>To get started please browse the <a href="/api">Saxon/C APIs</a>.
275
            <code>SaxonProcessor</code>, which acts as a factory class for generating the
276
         processors, is a good place to start.</p>
277

    
278
      <p>The <code>samples/cppTest</code> directory in the download provides example code in C/C++
279
         (and PHP and Python) which may also be helpful in learning how to use Saxon/C in your
280
         application. For further details see <a href="/samples/samples_c">Samples</a>.</p>
281

    
282
      <p>There are many parameters and options that can be set to control the way in which Saxon
283
         behaves. For more information about setting configuration features on
284
            <code>SaxonProcessor</code> and the other processors in Saxon/C, see <a
285
            href="/configuration">Configuration</a>.</p>
286

    
287
      <h2 class="subtitle">Command Line Interface</h2>
288

    
289
      <p>Saxon/C can be run from the command line in a similar way to its Java counterpart. See the
290
            <code>Transform.c</code> and <code>Query.c</code> files (and <code>Validate.c</code> for
291
         Saxon-EE/C) in the <code>command</code> directory. The <code>build.sh</code> script can be
292
         executed to build the command line programs.</p>
293

    
294
      <p>To run Saxon/C from the command line, the commands look like the following:</p>
295

    
296
      <kbd>./transform [options] [params]</kbd>
297
      <kbd>./query [options] [params]</kbd>
298
      <kbd>./validate [options] source.xml</kbd>
299

    
300
      <p>The same command line options as in the Java products are available in the Saxon/C command
301
         line tool. Please see the relevant sections of the Saxon 9.9 documentation for details:</p>
302

    
303
      <ul>
304
         <li>
305
            <a target="_blank"
306
               href="https://saxonica.com/documentation/index.html#!using-xsl/commandline">Running
307
               XSLT from the Command Line</a>
308
         </li>
309
         <li>
310
            <a target="_blank"
311
               href="https://saxonica.com/documentation/index.html#!using-xquery/commandline"
312
               >Running XQuery from the Command Line</a>
313
         </li>
314
         <li>
315
            <a target="_blank"
316
               href="https://saxonica.com/documentation/index.html#!schema-processing/commandline"
317
               >Running Validation from the Command Line</a>
318
         </li>
319
      </ul>
320

    
321

    
322

    
323
   </section>
324

    
325

    
326
   <section id="installingphp" title="PHP Extension">
327
      <h1>PHP Extension</h1>
328

    
329
      <p>The PHP extension is an interface module that allows Saxon/C to be invoked from PHP
330
         applications.</p>
331

    
332
      <h2 class="subtitle">Prerequisites</h2>
333

    
334
      <p>Please have the following packages on your machine to build Saxon/C for the PHP language:
335
            <code>make</code>, <code>php-devel</code>, (<code>php7.2-dev</code>),
336
            <code>apache2</code> or <code>httpd</code>, <code>gcc-c++</code> or <code>g++</code>,
337
            <code>gcj-jdk</code> (or just link the <code>jni.h</code> file in the
338
            <code>Saxon.C.API</code> directory).</p>
339

    
340
      <p>Saxon/C should already have been installed following the instructions at <a
341
            href="../installing">Installing Saxon/C</a>.</p>
342

    
343
      <h2 class="subtitle">Installing on Linux and Mac OS</h2>
344

    
345
      <!--<p>(Alternatively, you may like to use the installation script <a 
346
         href="https://saxonica.com/saxon-c/download/install.sh">install.sh</a> supplied by
347
         Petr Zak - written for a 64-bit machine, but can be changed for a 32-bit machine.)</p>-->
348

    
349
      <h3>Building with PHP7</h3>
350

    
351
      <p>The PHP extension is in the form of a C/C++ PHP7 extension to Saxon/C created using the
352
         Zend module API.</p>
353

    
354
      <p>To install, run the following commands:</p>
355

    
356
      <kbd>cd /usr/lib/Saxonica/Saxon-[EDITION]C[VERSION]/Saxon-C-API/</kbd>
357
      <kbd>phpize</kbd>
358
      <kbd>./configure --enable-saxon</kbd>
359
      <kbd>make</kbd>
360
      <kbd>sudo make install</kbd>
361

    
362
      <h3>Building with PHP5</h3>
363

    
364
      <p>The Saxon/C PHP extension is built for PHP7. To instead build with PHP5, first replace the
365
            <code>config.m4</code> file in the <code>Saxon-C-API/</code> directory with the one held
366
         in <code>Saxon-C-API/PHP5-Build</code>. Then run the installation steps above.</p>
367

    
368
      <p>Next create a module conf file: </p>
369

    
370
      <kbd>nano /etc/php/7.2/mods-available/20-saxon.ini</kbd>
371

    
372
      <p>with content:</p>
373

    
374
      <samp><![CDATA[; configuration for php Saxon HE/PE/EE module
375
         extension=saxon.so]]></samp>
376

    
377
      <p>and save the file. Now enable the module for PHP using the command:</p>
378

    
379
      <kbd>phpenmod saxon</kbd>
380

    
381
      <p>Alternatively, you can update the <code>php.ini</code> file or add the
382
            <code>20-saxon.ini</code> file under the <code>conf.d</code> directory (if using Ubuntu
383
         it is usually in the location <code>/etc/php/7.2/apache2/</code>) to contain the PHP
384
         extension. Insert the code <code>extension=saxon.so</code> in the Dynamic Extensions
385
         section, then run the following commands:</p>
386

    
387
      <kbd>sudo service apache2 restart</kbd>
388
      <kbd>php -m | grep saxon -i</kbd>
389

    
390
      <p>(Running these should display 'Saxon/C'.)</p>
391

    
392
      <p>If you cannot load the extension from the <code>php.ini</code> file, you need to load it at
393
         script execution time using the code: <code>dl(“saxon.so”);</code>. However this is not
394
         recommended as the loading and unloading can be slow.</p>
395

    
396
      <p>When working with PHP, the environment variables <code>LD_LIBRARY_PATH</code> and
397
            <code>SAXONC_HOME</code> should be added to the apache environment variables. The
398
         apache2 config file is located in one of the following locations depending on your linux
399
         distribution: </p>
400
      <ul>
401
         <li>Ubuntu server: <code>/etc/apache2/envvars</code></li>
402
         <li>Centos server: <code>/etc/sysconfig/httpd</code></li>
403
         <li>SUSE server: <code>/etc/sysconfig/apache2</code></li>
404
      </ul>
405

    
406
      <h2 class="subtitle">Installing on Windows</h2>
407

    
408
      <p>The PHP extension has not yet been built. It can be built using the PHP source. We hope to
409
         provide builds for PHP on Windows soon.</p>
410

    
411
      <p>On Windows we recommend setting the current working directory using the single-argument
412
         version of the <code>SaxonProcessor</code> constructor, because there remains an issue with
413
         building Saxon/C with PHP when using the function<code> VCWD_GETCWD</code>. That is,</p>
414

    
415
      <samp><![CDATA[$proc = new SaxonProcessor('C://www/html//trax//');]]></samp>
416

    
417
      <p>should replace instances of</p>
418

    
419
      <samp><![CDATA[$proc = new SaxonProcessor();]]></samp>
420

    
421
      <p>in your PHP scripts (see the <a href="/samples/samples_php">PHP Samples</a> for an
422
         example). </p>
423
   </section>
424

    
425
   <section id="installingpython" title="Python Extension">
426
      <h1>Python Extension</h1>
427

    
428
      <p>The Python extension is an interface module that allows Saxon/C to be invoked from Python
429
         applications.</p>
430

    
431
      <h2 class="subtitle">Prerequisites</h2>
432

    
433
      <p>Please have the following packages on your machine to build Saxon/C for the Python
434
         language: <code>Python3</code> (64-bit) and <code>Cython</code>.</p>
435

    
436
      <p>The Saxon/C Python extension API has been developed using Cython for Python3. Cython is
437
         required to build the extension library. To install Python and Cython on Mac OS, we
438
         recommend using brew or MacPorts.</p>
439

    
440
      <p>Saxon/C should already have been installed following the instructions at <a
441
            href="../installing">Installing Saxon/C</a>.</p>
442

    
443
      <h2 class="subtitle">Installing</h2>
444

    
445
      <p>The Python extension is held in the directory <code>Saxon.C.API/python-saxon</code>. </p>
446

    
447
      <h3>Linux and Mac OS Platforms</h3>
448
      <p>The Python extension on the Linux and Mac OS platforms can be built using the following
449
         command:</p>
450

    
451
      <kbd>python3 saxon-setup.py build_ext -if</kbd>
452

    
453
      <h3>Windows Platform</h3>
454

    
455
      <p>The Python extension on the Windows platform can be built using the following instructions:</p>
456
       <p>Install Python 3.X (64-bit) with VS 2017 or 2019 which can then be run
457
          with command "py" from Powershell.</p>
458

    
459

    
460
      <ul><li>For Python: update pip</li>
461
         <li>Use pip to install Cython: pip install Cython</li>
462
       <li>open Powershell for Python 3.X (with administrator rights if you
463
          installed in C:\Program Files)</li>
464
      </ul>
465
      <kbd>cd C:\Program Files\Saxonica\SaxonEDITIONX.X.X</kbd>
466
      <kbd>cd Saxon.C.API\python-saxon</kbd>
467
      <kbd>py saxon-setup.py build_ext -if</kbd>
468
       <p>For arbitrary Powershell Windows need to set: $Env:PYTHONPATH +=
469
       ";C:\Program Files\Saxonica\SaxonEDITIONX.X.X\Saxon.C.API\python-saxon" to
470
       ensure that "import saxonc" in any Python program finds the saxonc module</p>
471

    
472
   </section>
473

    
474
   <section id="troubleshooting" title="Troubleshooting">
475
      <h1>Troubleshooting</h1>
476

    
477
      <p>After installing Saxon/C, if you notice anomalies in execution, then the apache log file
478
         usually has useful information on errors reported and crashes. See below for a description
479
         of some of the common errors and crashes, and their solutions:</p>
480
      <ol>
481
         <li>
482
            <p>
483
               <code>FATAL ERROR: Unable to load /usr/lib64/rt/lib/amd64/libjava.so (libjvm.so
484
                  cannot open shared object file: No such file or directory) JNI_CreateJavaVM()
485
                  failed with result-1</code>
486
            </p>
487
            <p><b>Solution:</b> Running the following command should resolve the error:</p>
488
            <kbd>sudo ldconfig</kbd>
489
            <p>Ignore the message 'file /lib/libsaxon[EDITION].so is truncated'. The library was created using
490
            Excelsior Jet.</p>
491
            <p>Alternatively create a symlink to the java virtual machine. This is not required to
492
               install or compile, but it is required for PHP code. The following command should
493
               resolve the issue on a 64-bit machine:</p>
494
            <kbd>ln -s $JAVA_HOME/jre/lib/amd64/server/libjvm.so /lib64/libjvm.so<br/></kbd>
495
            <p>Alternatively, it is possible to link the libjvm.so from the 'rt/lib/jetjvm'
496
               directory.</p>
497
         </li>
498
         <li>
499
            <p>
500
               <code>/usr/lib/Saxon-C-API/SaxonProcessor.h:3:17: fatal error: jni.h: No such file or
501
                  directory <br/>#include &lt;jni.h&gt; compilation terminated.</code>
502
            </p>
503
            <p><b>Solution:</b> Link the <code>jni.h</code> on the machine or simply install
504
                  <code>gcj-jdk</code> which should resolve this error. </p>
505
         </li>
506
         <li>
507
            <p>
508
               <code>PHP Warning: PHP Startup: Unable to load dynamic library
509
                  '/usr/lib/php/modules/saxon.so' - libsaxonhec.so: cannot enable executable stack
510
                  as shared object requires: Permission denied in Unknown on line 0</code>
511
            </p>
512
            <p><b>Solution:</b> This has been observed on centos systems: SELinux is
513
               enforced/enabled.</p>
514
            <p>Run the following command to show the security setting for the library files:</p>
515
            <kbd>ls -alZ /usr/lib" and 'ls -alZ /usr/lib/php/module/</kbd>
516
            <p>Then run the following commands or similar to change the security context:</p>
517
            <kbd>chcon system_u:object_r:lib_t:s0 /usr/lib/libsaxonhec.so</kbd>
518
            <kbd>chcon system_u:object_r:lib_t:s0 /usr/lib/php/modules/saxon.so</kbd>
519
         </li>
520
         <li>
521
            <p>Some 64-bit Linux flavors do not run the 32-bit JET libraries by default.</p>
522
            <p><b>Solution:</b> For instance, <code>ia32-libs</code> must be installed on
523
               Ubuntu/Debian, e.g. using the following command:<br/>
524
            </p>
525
            <kbd>sudo apt-get install ia32-libs</kbd>
526
         </li>
527
         <li>
528
            <p><code>Unable to load C:\Program Files\Saxonica\SaxonHEC1.2.1\libsaxonhec.dll Error: : No error</code></p>
529
            <p><b>Cause and Solutions:</b> Running 32-bit environments including 32-bit python and PHP builds against Saxon/C which can only run with 64-bit builds.
530
            Machine operating system must be 64-bit, python and PHP builds must be 64-bit to run with Saxon/C.</p>
531
         </li>
532
      </ol>
533

    
534

    
535
   </section>
536

    
537

    
538
</article>
(9-9/10)