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

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

WBOY
WBOYOriginal
2016-06-13 09:16:081092browse

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' );

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

正式的生产环境配置

<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' );

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

 

Statement:
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