Display error CakePHP

7.1k Views Asked by At

CakePHP is displaying An Internal Error Has Occurred. but doesn't provide me with any information at all about it.

Even when I through an exception like this I still getting the same message An Internal Error Has Occurred.

throw new Exception("Error connecting with the database.");

I'm already using Configure::write('debug', 2); in my core.php

My php.ini contains display_errors = On and I even tried using the following in the controller's action:

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
1

There are 1 best solutions below

0
M.suleman Khan On

In order to Enable errors in cakephp.

Edit config/app.php

change this

'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),

to this

'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),

That's it now all errors will be shown.