<p>you need to pass in the settings inside the '*' section.</p>
<pre><code>    // Global settings
      '*' =&gt; [

        // Default Week Start Day (0 = Sunday, 1 = Monday...)
        'defaultWeekStartDay' =&gt; 1,

        // Whether generated URLs should omit &quot;index.php&quot;
        'omitScriptNameInUrls' =&gt; true,

        // The URI segment that tells Craft to load the control panel
        'cpTrigger' =&gt; App::env('CP_TRIGGER') ?: 'admin',

        // The secure key Craft will use for hashing and encrypting data
        'securityKey' =&gt; App::env('SECURITY_KEY'),

        // Whether Dev Mode should be enabled (see https://craftcms.com/guides/what-dev-mode-does)
        'devMode' =&gt; $isDev,

        // Whether administrative changes should be allowed
        'allowAdminChanges' =&gt; $isDev,

        // Whether crawlers should be allowed to index pages and following links
        'disallowRobots' =&gt; !$isProd,

        // https://craftcms.com/knowledge-base/enabling-fuzzy-search
        'defaultSearchTermOptions' =&gt; [
            'subLeft' =&gt; true,
        ],
  ],
</code></pre>
<p><a href="https://craftcms.com/docs/3.x/config/config-settings.html#system" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/config/config-settings.html#system</a></p>

CC BY-SA 4.0
2022-04-29T21:33:18.263Z
that's it. Thank you!
cringe002
CC BY-SA 4.0
2022-06-01T12:51:13.077Z
In addition to this, Craft changed `ENVIRONMENT` to `CRAFT_ENVIRONMENT` in the default setup, so ensure you change it too!
ianp
CC BY-SA 4.0
2022-04-29T20:59:30.973Z
2022-04-29T20:59:30.973Z
AngeloKeirsebilck
<p>I'm having trouble getting DevMode to work locally. I'm using nitro.</p>
<p>I have this set in my .env file...</p>
<pre><code>ENVIRONMENT=dev
</code></pre>
<p>... and my general.php file looks like...</p>
<pre><code>&lt;?php
/**
 * General Configuration
 *
 * All of your system's general configuration settings go in here. You can see a
 * list of the available settings in vendor/craftcms/cms/src/config/GeneralConfig.php.
 *
 * @see \craft\config\GeneralConfig
 */

use craft\helpers\App;

$isDev = App::env('ENVIRONMENT') === 'dev';
$isProd = App::env('ENVIRONMENT') === 'production';

return [
        // Default Week Start Day (0 = Sunday, 1 = Monday...)
        'defaultWeekStartDay' =&gt; 1,

        // Whether generated URLs should omit &quot;index.php&quot;
        'omitScriptNameInUrls' =&gt; true,

        // The URI segment that tells Craft to load the control panel
        'cpTrigger' =&gt; App::env('CP_TRIGGER') ?: 'admin',

        // The secure key Craft will use for hashing and encrypting data
        'securityKey' =&gt; App::env('SECURITY_KEY'),

        // Whether Dev Mode should be enabled (see https://craftcms.com/guides/what-dev-mode-does)
        'devMode' =&gt; $isDev,

        // Whether administrative changes should be allowed
        'allowAdminChanges' =&gt; $isDev,

        // Whether crawlers should be allowed to index pages and following links
        'disallowRobots' =&gt; !$isProd,

        // https://craftcms.com/knowledge-base/enabling-fuzzy-search
        'defaultSearchTermOptions' =&gt; [
            'subLeft' =&gt; true,
        ],

        // Global settings
            '*' =&gt; [
                'allowUpdates' =&gt; false,
                // ...
        ],

        // Dev environment settings
        'dev' =&gt; [
                'allowUpdates' =&gt; true,
                // ...
        ],
    
];

</code></pre>
<p>I've also tried just setting the devMode to true in the general.php file instead of relying on the .env file. I don't see verbose errors, and I don't see that dashed yellow line in the admin.</p>
<p>I'm using Servd for staging and its &quot;force devmode&quot; function seems to work.</p>
<p>I really just need it to show me the more verbose errors when I make mistakes in twig, which is a lot. I can look at the web.log for the errors, but that's much slower.</p>
<p>What else should I be looking at to debug this? Even if it's my .env file, the fact that directly setting it to true in the config makes me think there's something outside of these two files getting in the way.</p>

<nitro><devmode><env>
DevMode set to true, but doesn't appear to work locally
# DevMode set to true, but doesn't appear to work locally

(Asked by: username_0 on 2022-04-29)

I'm having trouble getting DevMode to work locally. I'm using nitro.
I have this set in my .env file...
ENVIRONMENT=dev

... and my general.php file looks like...
 1,

        // Whether generated URLs should omit "index.php"
        'omitScriptNameInUrls' => true,

        // The URI segment that tells Craft to load the control panel
        'cpTrigger' => App::env('CP_TRIGGER') ?: 'admin',

        // The secure key Craft will use for hashing and encrypting data
        'securityKey' => App::env('SECURITY_KEY'),

        // Whether Dev Mode should be enabled (see https://craftcms.com/guides/what-dev-mode-does)
        'devMode' => $isDev,

        // Whether administrative changes should be allowed
        'allowAdminChanges' => $isDev,

        // Whether crawlers should be allowed to index pages and following links
        'disallowRobots' => !$isProd,

        // https://craftcms.com/knowledge-base/enabling-fuzzy-search
        'defaultSearchTermOptions' => [
            'subLeft' => true,
        ],

        // Global settings
            '*' => [
                'allowUpdates' => false,
                // ...
        ],

        // Dev environment settings
        'dev' => [
                'allowUpdates' => true,
                // ...
        ],
    
];


I've also tried just setting the devMode to true in the general.php file instead of relying on the .env file. I don't see verbose errors, and I don't see that dashed yellow line in the admin.
I'm using Servd for staging and its "force devmode" function seems to work.
I really just need it to show me the more verbose errors when I make mistakes in twig, which is a lot. I can look at the web.log for the errors, but that's much slower.
What else should I be looking at to debug this? Even if it's my .env file, the fact that directly setting it to true in the config makes me think there's something outside of these two files getting in the way.

**Tags:** nitro, devmode, env

---

## 1 answers

### Answer by username_1 on 2022-04-29. Score: 4 | Accepted answer

you need to pass in the settings inside the '*' section.
    // Global settings
      '*' => [

        // Default Week Start Day (0 = Sunday, 1 = Monday...)
        'defaultWeekStartDay' => 1,

        // Whether generated URLs should omit "index.php"
        'omitScriptNameInUrls' => true,

        // The URI segment that tells Craft to load the control panel
        'cpTrigger' => App::env('CP_TRIGGER') ?: 'admin',

        // The secure key Craft will use for hashing and encrypting data
        'securityKey' => App::env('SECURITY_KEY'),

        // Whether Dev Mode should be enabled (see https://craftcms.com/guides/what-dev-mode-does)
        'devMode' => $isDev,

        // Whether administrative changes should be allowed
        'allowAdminChanges' => $isDev,

        // Whether crawlers should be allowed to index pages and following links
        'disallowRobots' => !$isProd,

        // https://craftcms.com/knowledge-base/enabling-fuzzy-search
        'defaultSearchTermOptions' => [
            'subLeft' => true,
        ],
  ],

https://craftcms.com/docs/3.x/config/config-settings.html#system

> **Comments:**
> **username_0**: that's it. Thank you!  
> **username_2**: In addition to this, Craft changed `ENVIRONMENT` to `CRAFT_ENVIRONMENT` in the default setup, so ensure you change it too!  

---

