Home > Backend Development > PHP Tutorial > Environment configuration in Yii2, Yii2 environment configuration_PHP tutorial

Environment configuration in Yii2, Yii2 environment configuration_PHP tutorial

WBOY
Release: 2016-07-13 10:08:48
Original
1081 people have browsed it

Environment configuration in Yii2, Yii2 environment configuration

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

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

Exceptions in this way will be caught by the Yii2 framework exception handling module

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/950254.htmlTechArticleEnvironment configuration in Yii2, the default Debug configuration of Yii2 environment configuration is defined in the entry file ( 'YII_DEBUG' ) or define ( 'YII_DEBUG', true ); defined ( 'YII_ENV' ) or define ( 'YII_EN...
Related labels:
source:php.cn
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template