Tavi depends on the external diff command to view the changes between document versions.

Unfortunately, this does not work on any web server. Tavi needs execute rights only for the diff command.
Fortunately, the diff funtionality can easily be replaced with a little native php.

First, install tavi and make sure it works. If you're publishing on third party webspace you may encounter other
problems like not being able to create symlinksa, but this can all be solved.

Now locate the diff.php file, placed in the 'lib' directory.
I changed to code to be like this (just remarked the original stuff out, so you can compare). (as of Tavi version \\0.24)

added \\ and < phpcode > to fix formatting PAH

modified diff.php


<?php
// $Id: diff.php,v 1.6 2003/04/28 00:34:04 kimmo Exp $

// Compute the difference between two sets of text.

function array_minus_array($a, $b) {
      $c=array_diff($a,$b);
       $c=array_intersect($c, $a);
      return $c;
}

function diff_compute($text1, $text2)
{
/*
  global $TempDir, $DiffCmd, $ErrorCreatingTemp, $ErrorWritingTemp;

  $num = strncmp(PHP_OS, "WIN", 3) ? posix_getpid() : rand();
  $TempDir = '/home/virtual/site63/fst/var/www/html/lib/tmp';
  $temp1 = $TempDir . '/wiki_' . $num . '_1.txt';
  $temp2 = $TempDir . '/wiki_' . $num . '_2.txt';
*/
/*
  if(!($h1 = fopen($temp1, 'w')) || !($h2 = fopen($temp2, 'w')))
    { die($ErrorCreatingTemp); }

  if(fwrite($h1, $text1) < 0 || fwrite($h2, $text2) < 0)
    { die($ErrorWritingTemp); }

  fclose($h1);
  fclose($h2);

  $diff = shell_exec ('$DiffCmd $temp1 $temp2');

  unlink($temp1);
  unlink($temp2);
*/
  //and now if temp files don't work:
  $texta=explode ("\n", $text1);
  $textb=explode ("\n", $text2);
  $diffab = "<TABLE>". //<TR><TD>Old</TD><TD>New</TD></TR><TR><TD>$text1</TD><TD>$text2</TD></TR>
  "<TR><TD>Removed:</TD><TD>Added:</TD></TR>
           <TR><TD>".nl2br(implode ("\n", array_minus_array ($texta, $textb)))."</TD>
             <TD>".nl2br(implode ("\n", array_minus_array ($textb, $texta)))."
             </TD></TR></TABLE>";
  return "<HR>".$diffab."<HR>";
}

// Parse diff output into nice HTML.
function diff_parse($text)
{
  global $DiffEngine;

//  return parseText($text, $DiffEngine, '');
  return $text;
}

?>


as you can see, i used the array_minus_array() functions, which do the job properly. Lay-out may be made nicer.
imho it would be a good idea if tavi natively has an option whether to use a php diff or externall diff. shellexec
just isn't available on many hosting providers.

This worked fine when implemented, many thanks! --morpheus