Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

NPH-BUILD.CGI error

Quote Reply
NPH-BUILD.CGI error
My error will seem familiar, but everyone here who responds to others with a similar problem keeps pointing to responses for this error as it relates to the links.cfg file and NOT the nph-build.cgi file. I just received the following error after my web host let the server my sites reside on run out of disk space and my error relates to the NPH-BUILD.CGI file. This is not a new installation so everyone's response to others with similar errors to "go do a search in the forums on this error" does NOT apply. I have yet to see a response specific to the nph-build.cgi file (and yes I searched) and for an old installation.

This is the error I'm getting after successfully using this script for 6 months:

Error Message : fatal error: Illegal division by zero at /usr/www/interrac/httpd/htdocs/allforwo/cgibin/links/admin/nph-build.cgi line 432, chunk 691.

It occurs right after it attempts to build the ratings. Line 432 and lines near it include the following:

if (exists $votes{$id}) {
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id}) /
($values[$db_votes] + $votes{$id});
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
print "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
print DBTMP &join_encode(&array_to_hash(0, @values));
}
close DB;
close DBTMP;

Can I get a response specific to the nph-build.cgi file when it attempts to update instead of the links.cfg file that everyone who has responded to people on here with similar errors seems to point everyone to? Thanks!


[This message has been edited by webdiva (edited March 21, 2000).]
Quote Reply
Re: NPH-BUILD.CGI error In reply to
hmm, have you checked your links.db? It sounds like it may have been corrupted.

If you try to divide a rating with a value of zero with a number of votes, you might get this kind of error message.

The values for the ratings are normally stored at position 11 while votes are at 12(check your links.def for the correct position).

You might also try a new, fresh copy of nph-build.cgi, since it may have been damaged in some way or another. Have you edited it in Notepad recently? I have noticed that Notepad sucks since it sometimes wraps or inserts linebreaks where it should not.

I hope this is of any help to you.



[This message has been edited by Luna (edited March 23, 2000).]