Import HTML -> Demo complains "No XSL library support at all on this server!" even though phpinfo() reports xml and xsl support is enabled. Details below. As will become clear, I'm just getting started, and know next to nothing about drupal or php. Can anyone point me in the right direction? Extensive googling has been no help this time. Thanks. -Mark
I'm running
Drupal 5.1 installed on Windows XP running Apache 2.0.55
PHP 5.2.2
Import HTML version 5.x-1.2
When I go to Inport HTML -> Demo and enter a URL like http://www.gbtc.org/index.html and click Next I get the error messages
- user error: No XSL library support at all on this server! in C:\Program Files\Apache Group\Apache2\htdocs\drupal\sites\all\modules\import_html\coders_php_library\xml-transform.inc on line 32.
- user error: Sorry, with no XML support there will be no content scanning AT ALL. Aborting process. See the import_html_help.htm for info on enabling XML under PHP. in C:\Program Files\Apache Group\Apache2\htdocs\drupal\sites\all\modules\import_html\import_html.module on line 1676.
- Failed to process file '/index.html'
When I go to line 32 in xml-transform.inc and clip the complaining function init_xsl, paste it into the following test file test.php, and run "php test.php" from the DOS command line, I get a "1" printed just as you would expect.
function init_xsl() {
// Just loading this lib means we really want to have XML
// OK, support both old & new PHP library ways of doing things ...
if (!extension_loaded('xsl') && !extension_loaded('xslt')) {
debug("Need to try and dynamically load XSL extension. Please do this properly on the server to avoid this message.");
if (!@dl('xslt.so')&&!@dl('php_xslt.dll')&&!@dl('php_xsl.dll')) {
trigger_error("No XSL library support at all on this server!" , E_USER_ERROR );
return FALSE;
}
debug("Ready to use XSL on the server",2);
}
return TRUE;
}
print init_xsl() . "\n";
This suggests to me that php support for xsl is enabled, contrary to the Import HTML error message. In fact, the phpinfo() report includes the following entries:
libxml libXML support => active libXML Version => 2.6.26 libXML streams => enabled xml XML Support => active XML Namespace Support => active libxml2 Version => 2.6.26 xmlreader XMLReader => enabled xmlwriter XMLWriter => enabled xsl XSL => enabled libxslt Version => 1.1.17 libxslt compiled against libxml Version => 2.6.26 EXSLT => enabled libexslt Version => 0.8.13
It is as if drupal and the command line are using different installations of php, but c:\php\php.exe is the only file on the computer with the name php.exe.
Comments
Comment #1
dman commentedWow. Now THAT is how to write an error report :) Great!
OK. My suspicion is that php from the command line is not using the same php.ini as the webserver does. It happens.
If you are using XAMMP, the actual php.ini is in the apache directory, and the one in the php directory is a red herring. In other windows-apache distros the php.ini may land in /windows dir.
Try phpinfo() in a web page and see if it's different. That'll tell you the real php.ini path as well.
Sounds like you enabled it right .. but in the wrong place. Yes, it would be nice if that was documented somewhere in the install (maybe it is) but I remember going through that process myself.
Try that.
Comment #2
mrtuttle commentedThanks for the tip.
and ran it from the command line and from the browser, and in both cases I got the same result:
But your tip together with two days of googling led me to the page http://drupal.org/node/146679 which points out that the PHP5 MSI installer adds c:\php\ to PATH but not c:\php\ext\, so Windows can't find php_xsl.dll and the other extension dlls in c:\php\ext\. Adding c:\php\ext\ to PATH solved the problem. I thought I might get the same effect by setting extension_dir to c:\php\ext in php.ini, but was surprised to see that php.ini was already doing this, so setting PATH seems like the right solution.
Going to tidy-functions.inc and adding quotation marks \" to line 137 as follows
solved all my problems. Now I have only to learn xml/xsl, and I'll be all set! 8-)
I recommend adding the following comment to the end of section Guide -> Installation/setup -> XML Support in import_html_help.htm:
Thanks again.
Mark
Comment #3
johnymap commentedHi i am having the same problem.
The only difference with me is that i am running ubuntu 6.04, Apache2 , Drupal 5.x
Can anyone please help me. How should i configure tidyhtml in my case.
Thank you in advance.
Comment #4
dman commentedtrouble with tidy on ubuntu is different from trouble with XSL on Windows....
Have you tried
sudo apt-get install php5-tidy?
Comment #5
johnymap commentedThanks dman
but this is the error that i get
sudo apt-get install php5-tidy
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package php5-tidy
Comment #6
dman commentedWorks for me.
You probably need to open up your repositories a bit. See the ubuntu howtos, and try enabling the universe.
My current install is from
php5-tidy [5.2.3-1ubuntu6.4] (5.2.3-1ubuntu6.4 Ubuntu:7.10/gutsy-updates)
Comment #7
dman commentedCleaning up issue queue by closing stuff from the Drupal-5 branch and over a year old.