import html can't find php xsl support
| Project: | Import HTML |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
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.
<?php
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.

#1
Wow. 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.
#2
Thanks for the tip.
<?php phpinfo() ?>Configuration File (php.ini) Path => C:\WINDOWSLoaded Configuration File => C:\php\php.ini
Config: Can't open "C:/Program"
Error: Can't open "Files/Apache"
Error: Can't open "Group/Apache2/htdocs/drupal/sites/all/modules/import_html/coders_php_library/xhtml_tidy.conf"
user warning: HTMLTidy failed to parse the input at all! It's probably very problematic HTML. A working version of tidy IS at c:/tidyhtml/tidy.exe isn't it? I ran c:/tidyhtml/tidy.exe -q -config C:/Program Files/Apache Group/Apache2/htdocs/drupal/sites/all/modules/import_html/coders_php_library/xhtml_tidy.conf "C:/WINDOWS/TEMP/htm2.tmp" and it returned: 2 in C:\Program Files\Apache Group\Apache2\htdocs\drupal\sites\all\modules\import_html\coders_php_library\tidy-functions.inc on line 156.
define("TIDY_OPTIONS"," -q -config \"".foreslash( dirname(__FILE__)."/xhtml_tidy.conf\" ") );I recommend adding the following comment to the end of section Guide -> Installation/setup -> XML Support in import_html_help.htm:
Thanks again.
Mark
#3
Hi 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.
#4
trouble with tidy on ubuntu is different from trouble with XSL on Windows....
Have you tried
sudo apt-get install php5-tidy?
#5
Thanks 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
#6
Works 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)