Bug #2222 » centos7setup.txt

Eirik Hanssen, 2015-11-25 09:10

# set up php5.5

yum install httpd

# enable ports:
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
systemctl start httpd
systemctl enable httpd
systemctl status httpd
# systemctl stop httpd

yum install wget

# get php5.5 from remi repo
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm

# Enable remi repo and specifically php5.5 repo:
nano -cw /etc/yum.repos.d/remi.repo

# install php
yum install php php-gd php-mysql php-mcrypt php-mbstring

# Saxon C setup

cd /opt
yum install zip unzip

# run the Saxon/C installer and give the install path: /usr/lib/saxonica

# fix permissions

chown -R root /usr/lib/saxonica
chmod -R u+r /usr/lib/saxonica

# create symlinks
ln -s /usr/lib/saxonica/ /usr/lib/
ln -s /usr/lib/saxonica/rt /usr/lib/rt

nano -cw /etc/
# add the following 3 lines:
#JetVM env path - required for Saxon


# Set apache envvars, on Centos7 this should be done in:
nano -cw /etc/sysconfig/httpd

# Append to the end of the file:
## Saxonica Saxon HEC support

# create a module configuration file:
nano -cw /etc/php.d/saxon.ini

# Add these two lines:
; configuration for php Saxon HEC module

# At this point the Saxon C module registers:
php -m | grep saxon -i

# And also phpinfo() has a proper Saxon/C section.
# But trying to run Saxon/C in php fails:

php /var/www/html/saxon-c/index.php
FATAL ERROR: Unable to load /usr/lib/saxonica/rt/lib/amd64/ ( cannot open shared object file: No such file or directory)
JNI_CreateJavaVM() failed with result-1

# however, adding a symlink to as you have pointed out earlier fixes this problem:
ln -s /usr/lib/saxonica/rt/lib/amd64/jetvm/ /usr/lib/

# trying php cli again:
php /var/www/html/saxon-c/index.php

# now the transformation works, the xslt transformation uses some xslt2 regex functions that work as intended

# Now running Saxon/C with commandline php works, but you still can't run Saxon/C with php through the apache web server:

# Trying to load the saxon-c page again (no output)

# Trying to troubleshoot:
[root@centos7 lib64]# systemctl status httpd -a | grep saxon

nov. 24 12:46:29 centos7.vm httpd[11166]: Unable to load /usr/lib/
nov. 24 12:46:29 centos7.vm httpd[11166]: /usr/lib/ doesn't contain public JNI_GetDefaultJavaVMInitArgs

# have tried adding these symlinks, but it doesn't help:

ln -s /lib/ /lib64/
ln -s /lib/ /lib64/

# any suggestions?