Social forum

Fatal error: Call to undefined function xslt_create()

 
Picture of Nik a
Fatal error: Call to undefined function xslt_create()
by Nik a - Monday, 30 June 2008, 6:18 AM
 

Hi Everyone,

                       I have PHP5 and Apache 2.2 installed. I am getting the error     Fatal error: Call to undefined function xslt_create() . I have copied the sablot.dll and Expat.dll in windows system 32 directory. My php info page shows that XSL is enabled but still i am getting this error. Please help.

Thanks & Regards,

Nik

Picture of Nik a
Re: Fatal error: Call to undefined function xslt_create()
by Nik a - Monday, 30 June 2008, 11:19 AM
 

Hi Everybody,
                              I got the solution. To make this work in PHP 5 follow the below instructions

1. Copy expat.dll,sablot.dll and iconv.dll to Windows/System 32 directory

2. Set your extension directory to Windows/System 32 directory

3. Most important thing is while transforming the document from one form to other use the below code for PHP 5

$xml = new DomDocument;
$xml->load($xmlfilename);

$xsl = new DomDocument;
$xsl->load($xsltfilename);

$proc = new xsltprocessor;
$proc->importStyleSheet($xsl);
$result = $proc->transformToXML($xml);

4. comment the line

extension=php_domxml.dll

This is because according to the php manual it shouldn't be included in php5, as it was replaced by the new DOM extension. The old DOM XML extension (php_domxml.dll) from PHP 4, has been moved to the PECL repository and is no longer bundled with PHP as of PHP 5.0.0..

5. If the line extension=php_xsl.dll is commented then uncomment(Remove the semi-colon) it.

6. Restart the server. It should work now :)

Picture of Tim Williams
Re: Fatal error: Call to undefined function xslt_create()
by Tim Williams - Monday, 4 August 2008, 2:07 PM
 
Catching up after multiple absences ....

As far as i'm aware there are three different XSLT mechanisms available in PHP, depending on the version of PHP you have :

1) PHP 5 DomXML
2) PHP 4 Sablot
3) PHP 4 DomXML

All three are supported in the current AutoView code and there is a detection routine which will test for the presence of all three, in the order listed above and use the first one found. Have a peek at "function process_xsl" in the lib.php and you'll see how this works.

If the code fails to find a suitable XSLT library, you should simply get a message telling you this in the AutoView window. With the current code function_exists('xslt_create') is called before trying to execute xslt_create(), so you should only see the invalid function error message for this method if the function_exists method is giving the wrong result, which is probably indicative of a faulty PHP installation.

Some of the first AutoView releases only had support for PHP 4 sablot, so if you are using an early version of the mod you might get this error, but the other methods were added soon after the initial release. If this is the case, then I strongly reccommend an upgrade to the latest AutoView release.