XSLT, Extensible Stylesheet Language (XSL) Transformations is a language for transforming XML documents into other XML documents. It is a standard defined by The World Wide Web Consortium (W3C). Information about XSLT and related technologies can be found at http://www.w3.org/TR/xslt.
PHP XSLT extension only supports the Sablotron library from the Ginger Alliance. The extension does not come standard with Redhat Enterprise... and the compilation was a bit tricky. So if you are having difficulty, theses notes may help you some...
The versions I used as of this writing are:
- Red Hat Enterprise Linux WS release 4 (Nahant Update 2)
- php-4.3.9-3.9
- sablotron-1.0.2-1.rf
- js-1.5-1.2.el4.rf
Note: If you need xslt support with PHP 5 you can use the XSL extension.
OK, lets get started:
- Get and install the latest js and js-devel RPMs from dags repository.
# rpm -Uvh dag.wieers.com/packages/js/js-
devel-1.5-1.2.el4.rf.i386.rpm
# rpm -Uvh dag.wieers.com/packages/js/js-1.5-1.2.el4.rf.i386.rpm - Download Sablotron source RPM from dags repository.
$ wget dag.wieers.com/packages/sablot
ron/sablotron-1.0.2-1.rf.src.r pm - Install the sablotron source RPM and remove "--with-readline" from the spec file.
$ rpm -ivh dag.wieers.com/packages/sablot
ron/sablotron-1.0.2-1.rf.src.r pm $ vi /usr/src/redhat/SPECS/sablotro
n.spec
[ begin remove ]
--with-readline \
[ end remove ] - Build and install sablotron and sablotron-devel packages.
$ rpmbuild -bb /usr/src/redhat/SPECS/sablotro
n.spec # rpm -Uvh /usr/src/redhat/RPMS/i386/sabl
otron*.rpm - Download the php source RPM from Redhat.
$ wget ftp.redhat.com/pub/redhat/linu
x/updates/enterprise/4WS/en/os /SRPMS/php-4.3.9-3.9.src.rpm - Install the php source RPM and add, "--enable-xslt --with-xslt-sablot --with-sablot-js=%{_prefix}&qu
ot; to the spec file.
$ rpm -ivh /usr/src/redhat/SRPMS/php-4.3.
9-3.9.src.rpm $ vi /usr/src/redhat/SPECS/php.spec
[ begin add ]
--enable-xslt \
--with-xslt-sablot \
--with-sablot-js=%{_prefix} \
[ end add ] - Optionally add "BuildRequires: sablotron-devel, js-devel" to the spec file, helpful in stopping a build early if something is missing.
[ begin add ]
BuildRequires: sablotron-devel, js-devel
[ end add ] - On running rpmbuild, you may notice some additional missing dependencies.
- Install the missing packages. Most of what I had to install was devel packages.
# up2date -i [missing-packages]
- Build and force install the php packages.
$ rpmbuild -bb /usr/src/redhat/SPECS/php.spec
# rpm -Uvh /usr/src/redhat/RPMS/i386/php*
--force - Restart apache.
# service httpd restart
- Test with "<? phpinfo(); ?>". It should list XSLT support as being enabled.
- Edit the up2date config to skip future php updates.
- sandip's blog
- Login or register to post comments
Comments
Thanks for the sablotron compile tip! Removing the readline support the build proccess runs correctly!
I noticed this blog coming up as the number 1 result on google with the keyword: "xslt php rpm" on google and it's not even been a month since the blog was posted... If you are looking for info or having difficulty, please don't hesitate to post here.
After spending three days searching for a way to make XSLT work on RHEL4 PHP4.3.9 sandip simple instructions fixed everything! Large learning cure this linux thing is but keep you young.