ExpressionEngine PHP Error: Non-static method should not be called statically

Problem

A PHP Error was encountered
Severity: 8192
Message: Non-static method Mx_calc::usage() should not be called statically, assuming $this from incompatible context
Filename: mx_calc/pi.mx_calc.php
Line Number: 20

and

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at PATH/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 479

Solution

In this case, we need to modify Mx_calc, as stated in the error message:

  1. Go to /system/expressionengine/third_party/mx_calc/pi.mx_calc.php
  2. Look for function usage() around line 61
  3. Replace it with public static function usage()

Before

function usage()
{
ob_start();
?>

After

public static function usage()
{
ob_start();
?>