Alrighty. Yeah, I see it now; it's loading in that not-so-blank line and trying to explode/divide with the data that... doesn't exist! :p
Try this script instead:
<?php
// Associate the file to the filename variable
$filename = 'bkup04.log';
// Open the file and read line by line
$fp = fopen("$filename", "r") or die("Couldn't open $filename");
while (!feof($fp)) {
$line = fgets($fp);
if(strlen($line) < 2) continue;
$line_array = explode(" ", $line);
print count($line_array);
$line_array[7] = date("Y-m-d H:i:s", $line_array[7]);
$line_array[8] = $line_array[4] / $line_array[1];
settype($line_array[8], "integer");
echo "$line_array[7]\n";
echo "$line_array[8]\n";
}
fclose($fp);
?>
If you'll notice my addition with the IF statement, it'll ignore any line that has less than 2 characters. Feel free to up that limit, but for now, it seems to be working.
EDIT: Since you're hard-coding the 7th and 8th positions, you could even use count() to check if there are 6 array elements after exploding, and 'continue;' if there aren't.
EDIT2: Since you haven't responded for a while, I'm assuming you either fell asleep at your keyboard or put this off till morning. I've experienced a succession of catastrophic events these past few days, so I think I'll turn in for the night 😉