关于环境配置在Laravel4.2文档中有如下介绍:
Next, we need to instruct the framework how to determine which environment it is running in. The default environment is always
production
. However, you may setup other environments within thebootstrap/start.php
file at the root of your installation. In this file you will find an$app->detectEnvironment
call. The array passed to this method is used to determine the current environment. You may add other environments and machine names to the array as needed.
<?php $env = $app->detectEnvironment(array( 'local' => array('your-machine-name'), ));
如果你不做任何修改,默认的,你运行的环境就是 production , 但是如果你改成下面的形式:
<?php $env = $app->detectEnvironment(array( 'local' => array('baren-PC'), ));
那么你运行环境就变成local了