As I said, this is done outside of PHP, so you will have to obtain and install wvware yourself. It's installed on my Mandrake Linux system, but the wvText script is broken, so I have to use wvHtml and then use Lynx to translate the HTML into text. Here is an example that works.
<?
$docfile = "somefile.doc";
$cmd = "bash -c \"wvHtml $docfile | lynx -stdin --dump\" ";
// open a pipe to the command and read the results
$fd = popen($cmd, "r");
$buf = fread($fd, 10000);
pclose($fd);
// now $buf contains a translated version of docfile
// you can search it; here we display it.
echo "<PRE>$buf</PRE>";
?>