Useful debugging things

Debugging arrays

//Echo a bool value:
  echo($MyBoolVariable ? 'true' : 'false');

Display errors

Add “display_errors = On” in your PHP configuration file to cause errors to be displayed.  This is a really useful debugging feature and is often the best first step of debuigging to determin why something isn’t working.

Turning on in a file
error_reporting(E_ALL); ini_set('display_errors', 'On');     //SHOW PHP ERRORS

Tip: Look for a error_log file created on the remote server in the files directory

Displaying An Error

Try
{
}
catch (Exception $e)
{
    echo $e->getMessage();
}

Show full PHP install information

  //Display PHP install full information
  phpinfo();
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *