Support » Fixing WordPress » Warning: Division by zero

  • For a year now, everything has run smoothly. I’ve gone through two upgrades without any major problems and suddenly, yesterday I start getting emails from my readers that they can’t access the site.

    Warning: Division by zero in /home/shag/domains/ on line 517

    I will include that originally, I still had 1.5.2 installed. I was hopping that the 2.0 upgrade might fix the problem. Instead, it just moved the error from line 478 to line 517.

    Anyone have an idea as to why this would suddenly become an issue?

Viewing 6 replies - 1 through 6 (of 6 total)
  • It’s probably doing a division calculation and trying to divide by zero, and that will crash any computer on the planet (if it’s not trapped.)

    About line 517 in 2.0 is “function posts_nav_link” which does indeed contain division. Looks like posts per page is zero. Anyone know why that could be happening?

    $max_num_pages = ceil($numposts / $posts_per_page);

    At the very least, is anyone more familiar with coding and can help me with what I could replace that line with (or can it be deleted all together)?

    What is your posts per page set to in your admin area?


    Hmm, weird.

    Ah hah! I posted that from memory and then walked away to run an office errand. It occurred to me that I should check the Admin Option for that and make sure I didn’t fib. Somehow, the option had been reset to zero (obviously the source of the error).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warning: Division by zero’ is closed to new replies.