Default Debug configuration
In the entry file
<span>defined</span> ( 'YII_DEBUG' ) or <span>define</span> ( 'YII_DEBUG', <span>true</span><span> ); </span><span>defined</span> ( 'YII_ENV' ) or <span>define</span> ( 'YII_ENV', 'dev' );
After the above configuration, all exceptions will be displayed directly on the page, which is the popular page
Formal production environment configuration
<span>defined</span> ( 'YII_DEBUG' ) or <span>define</span> ( 'YII_DEBUG', <span>false</span><span> ); </span><span>defined</span> ( 'YII_ENV' ) or <span>define</span> ( 'YII_ENV', 'PRODUCTION' );
Exceptions in this way will be caught by the Yii2 framework exception handling module