According to "Michael \"NightEye\" Aeberhard":
> I've tried the query from the command line and it works PERFECTLY! But now
> on PHP, I'm getting this error:
>
> Unable to read word database file
> '/home/sites/site21/local/htdig/db/db.words.db'Did you run htmerge?
>
> But my databases are in ../local/htdig/db/roguespear.
>
> What I'm guessing is that my query that specifies the config file is not
> being properly sent to the htsearch program.
Either that or the compiled in value for CONFIG_DIR is not what you think
it is.
> Here's my PHP code - as you can see I've done away with PHP variable and
> used the EXACT same query I used on the command line:
>
> $words = EscapeShellCmd(UrlEncode($search));
> $config = EscapeShellCmd(UrlEncode("roguespear"));
> $format = EscapeShellCmd(UrlEncode("roguespear"));
> $query = "config=$config&format=$format&words=$words";
>
> $command="/home/sites/site21/local/htdig/bin/htsearch \"$query\"";
> echo $command;
> exec("/home/sites/site21/local/htdig/bin/htsearch
> \"config=roguespear&format=roguespear&words=nato\"",$result);
>
> That will print out the error specified above.
The query string looks fine to me, and it's properly quoted (unless PHP
doesn't handle \" within double quotes the way I think it should).
This would suggest to me that your CONFIG_DIR isn't where you think it
should be, or there's a problem in your roguespear.conf file in there.
> Reason I'm not using a wrapper script is because it gives me an error as
> well - and I've had more luck with this method. The error when I use a
> wrapper script comes up in my /etc/httpd/logs/error error log. And that
> error is:
>
> : not a legal variable name
> : No such file or directorydig/htdig.sh: /home/sites/site21/local/htdig/bin
>
> I'm dying for more suggestions - this is going beyond frusteration for me.
Well, it's hard to tell from the error message above if the messages are
being mangled by your mailer, or something else, but it does look odd to
me. Especially the ": No such file or directory" error, which suggests
either an empty string or a name with a new line or carriage-return
character embedded at the end. Could you send us a "cat -v -t -e" of
your wrapper script?
--
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