The Slim framework allows us to enable a debugging mode. Once doing it, each time an exception is thrown the Slim framework will generate a detailed debugging message. The following code sample shows how to do it.


namespace Com\LifeMichael\Samples;

require 'Slim/Slim.php';


$application = new \Slim\Slim(array('debug' => false));

    function ()
        $temp = 1/0;
        echo "<data>response sum=$sum</data>";



The following video clip overviews this code sample, shows its execution and provides a detailed explanation for each and every part of it.

You can find more video clips, code samples and training material for learning the Slim framework in my online free courses website at

Leave a Reply

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