Call to undefined function: xslt_create()
You have configured PHP with --enable-xslt --with-xslt-sablot. You google. Everyone tells you to recompile your PHP using the above options and it works. You tear off your hair as you have already used the options but you still get the error. You dont get much help anywhere. You think of leaving out the xslt part or even leaving PHP completly.
Then you find something regarding PHP5. You think of upgrading to PHP5 to avoid such frustrations as PHP5 uses DOM.
If this is your story you are at the right place because i have been through the same. I wasted around 2 days searching for it.
After much search i found 2 pages that helped me get through though not completly.
(please chk the comments on)
For PHP4 to use xslt you need to install expat and sablot in the given order.
How to install sablotron with PHP
You need to first install expat, followed by Sablotron. Then you need to reinstall PHP. This is the method we used :-
Get source for expat
http://sourceforge.net/projects/expat/ (check for latest)
tar -pxzf expat-1.95.8.tar.gz
*Make sure that /etc/ld.so.conf contains /usr/local/lib
Get the source from http://www.gingerall.com
tar -pxzf Sablot-1.0.2.tar.gz
./configure --prefix=/usr --with-expat --with-iconv
Sablot has a seg fault bug. Install its patch.
try reinstalling PHP with --enable-xslt --with-xslt-sablot. If you dont get the Call to undefined function: xslt_create() error, you are lucky.
- Check the version of PHP installed. Simplest option would be run page with as you would need the original configure options.
- Download the PHP source for same version.
- Extract the source. cd to the source dir. Then cd ext/xslt.
- vi config.m4 (steps 4 and 5 may not be needed)
- comment these 3 lines:
PHP_SETUP_ICONV(XSLT_SHARED_LIBADD, , [
AC_MSG_ERROR([iconv not found, in order to build sablotron you
need the iconv library])
./configure --enable-xslt --with-xslt-sablot=/usr/local + (the original configure options)
- xslt.so is created in modules directory in srcdir/ext/xslt/modules copy it to /usr/lib/php4. Change its permissions.
- cd /usr/local/lib. Change the permissions for libexpat.a and libsablot.a.
For RH8 and RH9 you may need to add extension=xslt.so.