Page 1 of 1

XSL transforms in PHP for Linux

Posted: Tue Jun 24, 2003 11:00 pm
by jonah
Slackware Linux 9.0 machine with Apache 1.3.27, MySQL 3.23.56
and PHP 4.3.1 constitutes the Web environment in which I would
like to add XSLT capabilities. I understand from various sources
that I will have to add to this setup, libiconv and sablotron.

The current setup (phpinfo) reveals the following XML capabilities:

XML Support active
XML Namespace Support active
EXPAT Version 1.95.2

I have attempted to run some of the XSLT examples described
in the PHP manual, but of course cannot get past the most
preliminary directive $xsltproc = xslt_create(); which produces
the Apache error_log message:

[Tue Jun 24 21:38:14 2003] [error] PHP Fatal error:
Call to undefined function: xslt_create() in ...

I don't want to recompile PHP from source to add XSLT capability
and was wondering if there is a binary add-on for Sablotron
or some other way to add transforms without disturbing my
current setup?

Any help or suggestions appreciated.

Posted: Wed Jun 25, 2003 3:28 pm
by enygma
Yup, here's the steps you'll need to take:

- Download the Sablotron libraries from here: http://www.gingerall.com/charlie/ga/xml/d_sab.xml
- Install them and get that working
- recompile PHP with the following options included with your others:
--enable-xslt --with-xslt-sablot
- hopefully, if you installed the Sablotron stuff somewhere it can find it, it should have no issues.

Once that finishes, try out a sample call to xslt_process or just make a phpinfo() page.....

Re: XSL transforms in PHP for Linux

Posted: Wed Jun 25, 2003 4:00 pm
by cactus
jonah wrote:I don't want to recompile PHP from source to add XSLT capability and was wondering if there is a binary add-on for Sablotron or some other way to add transforms without disturbing my current setup?
You can't get away from it, the extensions are only available once you have compiled PHP (with ext. libs) to use them.

I don't use Slackware's packages for PHP (as I like to have my own config) but they may provide you with a binary of PHP that can link (ldso) with the libs you require.

Regards,

BTW, nice to see a fellow Slackware user on the board ;)

Posted: Wed Jun 25, 2003 4:01 pm
by jonah
Yes, but I was trying to avoid recompiling PHP from source;
I'd just as soon keep the binary distribution intact.

I notice that there is an extension for MySQL

usr/lib/php/extensions/mysql.so

and am wondering, if something similar would appear if I
recompiled with xslt/sablotron, could I bypass the compile step
and add the extension manually?

Now, don't laugh, maybe it can be done. After all the php manual
talks about an extension API.

Posted: Wed Jun 25, 2003 4:15 pm
by cactus
You still have to "make" "make install" to create the binary, recompiling the source will not result in a *.so for your DOM/XSL libs.

(I can't believe I'm going to say this...) Windows is better for adding extensions in the manner as all you need to do is add it to the config. (... no flames please, I do have Win32 friends!) ;)

Sorry.

Regards,

Posted: Thu Jun 26, 2003 4:35 am
by volka
there are dynamic extension on linux systems, too.
Couldn't find the package you need for slackware but take a look at the redhat page (e.g. http://www.redhat.com/swr/i386/php-ldap-4.2.2-17.i386.html)
Not the xslt package but just proof that there are precompiled extensions on *nix-systems ;)
http://www.php.net/manual/en/install.configure.php wrote:For a complete up-to-date list of configure options, run ./configure --help in your PHP source directory after running autoconf (see also the Installation chapter).
this e.g. includes --enable-shared[=PKGS]

Posted: Thu Jun 26, 2003 9:19 am
by jonah
Following up on volka's comment, has anyone used the Slack
rpm2tgz utility to try to install or at least look at the Redhat
rpm PHP binary he refer's to?

I would think that trying to install a binary meant for a RedHat
distribution on a Slack system would probably create a non-working
setup but you never know till you try.