This bug occurs on a virtual server running SuSE 7.5:

htmltidy.module tries to find the tidy binary.
If the file is found, a test is run (line 528) to get the tidy version (i think) with
$result = exec('tidy -v', $response)

normally, the response from tidy is a single line with version info, but on that SuSE system, the resposne is

[empty line]
HTML Tidy for Linux/x86 (release date: ...
See http://... for details

the first empty line seems to cause the problem, that tidy executable is found but not used (this is, what the drupal error message says).

I tried to fix the bug like this:

  // now test it
  $command = escapeshellcmd("$tidypath -v");
  # drupal_set_message("Running command <br/>\n$command", 1);
  // old
  //$result = exec($command, $response); // works on Gentoo linux, not on SuSE 7.5

  // new
  passthru($command, $result); // $result of 0 is: no error, actually does not return the version number of tidy; see http://de3.php.net/manual/en/function.passthru.php

  if(0 != $result){
    $message = "Found 'tidy' binary, but it didn't run right. \n$command\nfailed to respond correctly";
    return FALSE;
  }

  # drupal_set_message("Looks like tidy is ready for use! ".$result);
  $message = $result;
  return TRUE;
} // function htmltidy_test

maybe this helps somebody.

Comments

Lil Devil’s picture

I ran into this problem also. But after futzing around for a while, I noticed the head-slapping solution: I had to mark tidy as executable (CHMOD 755). D'oh!

This should probably be added to the "INSTALL.txt" and "put_tidy_here.txt" files so other neophytes don't struggle as I did.

mlncn’s picture

Version: 4.7.x-1.x-dev » 6.x-1.0
Category: bug » support

Same deal in 6.x.

HTMLTidy executable is not available. Found a 'tidy' binary, but it didn't run right. /home/ben/code/pdonline/drupal/profiles/scf/modules/contrib/htmltidy/bin/tidy -v failed to respond correctly

chmod 755 on tidy didn't help.

Using the MkLinux download.

Does anyone know exactly what to download for Ubuntu?

mattwmc’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

I'm having the same problem for Linux:

HTMLTidy executable is not available. Found 'tidy' binary, but it didn't run right. /home/content/xxx/bin/tidy -v failed to respond correctly

Also using the tidy_mklinux download - is that the correct one to use?

Any ideas?

Thanks.

colan’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Category: support » bug
Status: Active » Postponed (maintainer needs more info)

Is this still a problem in D7 (where it would need to be fixed first)?