According to Ted Stresen-Reuter:
> htdig.org indicates that you need to use a wrapper with PHP but I've been
> quite successful using htdig without a wrapper by calling the program
> directly from PHP (exec("/usr/local/htdig/bin/htsearch $QUERY_STRING",
> $results, $exit_code);) and then parsing the results displaying them as
> desired.
Yes, your PHP code in which you call htsearch and parse its results is,
technically, a wrapper, because the web browser isn't calling htsearch
directly through the web server's CGI interface. Not all wrappers are
shell scripts. I don't think anything in the FAQ implies you need to
use a shell script to call htsearch from a PHP script.
Colin Viebrock's DevShed article does use a shell script for this purpose,
but that article was written in 1999, before htsearch handled the query
string as a command line argument.
> In fact, I'm just starting to develop an htdig class to simplify
> the display of results. I'd be more than willing to share the code once I've
> got something worth sharing. Anyone care to help?
>
> On another note, when I run rundig from PHP it appears to index the site but
> at the very end it outputs the following line (using rundig -v): htpurge:
> Database is empty!
>
> Is this a problem?
Yes, I would tend to think that an empty database is a problem. Maybe you
have a problem with write access to the database files, or the database
directory, from PHP. Wouldn't the PHP code run as the user ID under
which the web server runs? Having your databases writable by that user
ID doesn't strike me as being all that secure, but I think that's the
only way you'd be able to run rundig from the web server.
--
Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba Phone: (204)789-3766
Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html