Which environment do you want the application to be initialized in?
[0] Development [1] Production
Your choice [0-1, or "q" to quit] 1
Initialize the application under 'Production' environment? [yes|no]
开发环境和生产环境 选择的时候有啥区别 ?
另外环境能否切换 比如原来是开发环境 想切换到生产环境
没有太大的区别,熟悉Yii2,你就会知道,
开发环境开启了debug的功能,也就是在页面显示报错。
如果你是develop安装的,到了线上你要切换product模式,那么,进入到 @app/web/index.php
将:
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev');
改成
defined('YII_DEBUG') or define('YII_DEBUG', false); defined('YII_ENV') or define('YII_ENV', 'prod');
THANKS