How to Enable/Disable debug mode in CakePHP

How to Enable/Disable debug mode in CakePHP

To enable debug mode in CakePHP go to config folder and open app.php

chrome rNATJGNnpo - How to Enable/Disable debug mode in CakePHP

find ‘debug’ => filter_var(env(‘DEBUG’, false), FILTER_VALIDATE_BOOLEAN), and change the value of debug false to true

chrome k6U0n4wnwb - How to Enable/Disable debug mode in CakePHP


Older CakePHP versions

To enable debug mode in older versions of CakePHP go to Config folder and open core.php

chrome sJZN1Yn23L - How to Enable/Disable debug mode in CakePHP

find Configure::write(‘debug’, 0); and change the value of debug to 1 or 2

chrome DtihVBkbAo - How to Enable/Disable debug mode in CakePHP

  • 0: No error messages, errors, or warnings shown. Flash messages redirect.
  • 1: Errors and warnings shown, model caches refreshed, flash messages halted.
  • 2: As in 1, but also with full debug messages and SQL output.

then visit the website and the error will be displayed:

52jGJiP - How to Enable/Disable debug mode in CakePHP

To disable debug log simply change the number back to 0.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.