Home > php教程 > php手册 > Yii2中的环境配置,Yii2环境配置

Yii2中的环境配置,Yii2环境配置

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 09:16:08
Original
1121 people have browsed it

Yii2中的环境配置,Yii2环境配置

默认的Debug配置

 在入口文件中

<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' );
Copy after login

以上配置后,所有的异常会直接显示在页面,也就是爆红页面

正式的生产环境配置

<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' );
Copy after login

这样有异常会被Yii2框架异常处理模块捕获

 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template