I installed it all and downloaded the latest executable tiny.exe, it's available in the right directory. However, when I go to the config page of HTMLtidy I get the following warning:

* warning: exec() [function.exec]: Unable to fork [C:/inetpub/Drupal/modules/htmltidy/bin/tidy.exe -v] in C:\inetpub\Drupal\modules\htmltidy\htmltidy.module on line 536.
* HTMLTidy executable is not available. Found a 'tidy' binary, but it didn't run right. C:/inetpub/Drupal/modules/htmltidy/bin/tidy.exe -v failed to respond correctly

When I run the given commandline in the shell, it returns HTML Tidy for Windows released on 15 August 2007

What else could I check?

CommentFileSizeAuthor
#2 htmltidy.module_2.patch1.57 KBms2011
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fiishi’s picture

I had the same problem. My drupal path is under Program Files so there are spaces. Problem was fixed when I added quotes around the path.
In the function htmltidy_test, I changed this line:

$command = escapeshellcmd($tidypath .' -v');

to this:

if (substr(PHP_OS, 0, 3) == 'WIN') {
  // On Windows, enclose path with quotes.
  $command = '"'.escapeshellcmd($tidypath).'" -v';
}
else {
  $command = escapeshellcmd($tidypath .' -v');
}

Quotes are added after the call to escapeshellcmd because escapeshellcmd seems to strip out the quotes. There is probably a more elegant way of adding the quotes.

ms2011’s picture

Status: Active » Needs review
FileSize
1.57 KB

Same problem here. Here was my way of adding quotes.

(see attached)

annegentle’s picture

I have this same problem on Windows. I’ve done the config steps and from a Windows CMD window I can run tidy -v from any directory and get:
HTML Tidy release date: 30th April 2000
See http://www.w3.org/People/Raggett for details

However, Drupal reports the following: HTMLTidy executable is not available. Found ‘tidy’ binary, but it didn’t run right. C:/Program Files/BitNami Drupal 6 Stack/apps/drupal/htdocs/sites/all/modules/import_html/coders_php_library/bin/tidy.exe -v failed to respond correctly

If I run the exact thing on the server, I get “‘C:/Program’ is not recognized as an internal or external command, operable program, or batch file.” I’m sure this error occurs due to the spaces in the path, but even when I placed the tidy.exe in C:\Tidy, and changed the path, I get the error: “HTMLTidy executable is not available. Couldn’t find tidy binary anywhere!”

Even if I move the tidy.exe to C:\tidy\ and change the Import_HTML settings to point to /tidy (the default is /usr/local/bin/tidy) to remove spaces in the path, I get the same error.

With a tidy release date of 2000, I'm suspecting that there are 2 tidy.exes on this machine and I need to find a newer one and get rid of the old. Any other suggestions are welcome. Thanks.

annegentle’s picture

To answer my own question, my suspicions were correct. I needed to reinstall with no spaces in the path, plus get a new tidy.exe file that was a more recent build.

michaelfavia’s picture

Status: Needs review » Closed (fixed)

5.x is no longer maintained. please upgrade or submit a patch and ill be happy to roll it in.