Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Lil Devil CreditAttribution: Lil Devil commentedI 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.
Comment #2
mlncn CreditAttribution: mlncn commentedSame deal in 6.x.
chmod 755 on tidy didn't help.
Using the MkLinux download.
Does anyone know exactly what to download for Ubuntu?
Comment #3
mattwmc CreditAttribution: mattwmc commentedI'm having the same problem for Linux:
Also using the tidy_mklinux download - is that the correct one to use?
Any ideas?
Thanks.
Comment #4
colanIs this still a problem in D7 (where it would need to be fixed first)?