I keep getting the same three error messages. This is the case in my main forum and also in the test forum. I completely reinstalled the test forum yesterday, but one of the errors is already reported there.
It appears when I click on the admin button in the menu after logging in and also when I click on "Administration Center" in the menu on mouseover over the admin button.
That's the error message, what's wrong there in the code?
Type of error: General
Warning: Trying to access array offset on value of type bool
30 // The internal function should always be available
31 if (function_exists('sys_getloadavg'))
33 $sys_load = sys_getloadavg();
34 return $sys_load / $cores;
sys_getloadavg() is for some reason returning false rather than an array - but I’m not on my desktop to look at the rest of it to see how safely to change it.
Maybe it should be
// The internal function should always be available
$sys_load = sys_getloadavg();
return $sys_load / $cores;
Not 100% sure if the indentation is perfect, tabs on iPad are hard! But if it’s not an array it shouldn’t be using that method to return.
Thank you, that helped!
In both forums, the error messages now stay away. :)
Interesting it is returning a bool. I'll add this to the 1.1.9 tracker
sys_getloadavg() does say in the manual it can return false. But it never explains why it would return false, merely 'on failure' and 'this isn't implemented on Windows' (not that the OP has a Windows setup)
SMF originally used a combination of querying /proc/loadavg and calling uptime on the command line to identify this.
Well would you look at that, it indeed says array|false :-[