2007-11-10, 01:28 PM
Hi all!
After moving MyBB from a Windows/IIS server to Linux/Apache, I now and then get a division by zero error on loading the forum web pages (not always).
The error message is:
Warning: Division by zero in /var/www/mybb/inc/functions.php on line 28
Warning: Division by zero in /var/www/mybb/inc/functions.php on line 29
Warning: Cannot modify header information - headers already sent by (output started at /var/www/mybb/inc/functions.php:28) in /var/www/mybb/inc/functions.php on line 78
The code at lines 28/29 reads:
$percentphp = number_format((($phptime/$maintimer->totaltime)*100), 2);
$percentsql = number_format((($querytime/$maintimer->totaltime)*100), 2);
So, apparantly $maintimes->totaltime at some occasions is zero. Anyone know what may cause this problem?
After moving MyBB from a Windows/IIS server to Linux/Apache, I now and then get a division by zero error on loading the forum web pages (not always).
The error message is:
Warning: Division by zero in /var/www/mybb/inc/functions.php on line 28
Warning: Division by zero in /var/www/mybb/inc/functions.php on line 29
Warning: Cannot modify header information - headers already sent by (output started at /var/www/mybb/inc/functions.php:28) in /var/www/mybb/inc/functions.php on line 78
The code at lines 28/29 reads:
$percentphp = number_format((($phptime/$maintimer->totaltime)*100), 2);
$percentsql = number_format((($querytime/$maintimer->totaltime)*100), 2);
So, apparantly $maintimes->totaltime at some occasions is zero. Anyone know what may cause this problem?