2

I am using .env to set environment to local:

# .ENV The environment Craft is currently running in ('dev', 'staging', 
'production', etc.)
 CRAFTENV_CRAFT_ENVIRONMENT="local"

My general config looks like:

 // Dev environment settings
'local' => [
    'devMode' => true,

    // Base site URL
    'siteUrl' => getenv('CRAFTENV_BASE_URL')

],

My staging site is :

 // Staging environment settings
'staging' => [
    // Base site URL
    'siteUrl' => getenv('CRAFTENV_BASE_URL'),

    // Dev Mode (see https://craftcms.com/support/dev-mode)
    'devMode' => true,

    'baseUrl'  => getenv('CRAFTENV_BASE_URL'),
    'basePath' => getenv('CRAFTENV_BASE_PATH'),
    'aliases' => [
        '@assetBaseUrl' => getenv('ASSET_BASE_URL'),
        '@assetBasePath' => getenv('ASSET_BASE_PATH'),
        '@baseUrl' => getenv('CRAFTENV_BASE_URL'),
        '@basePath' => getenv('CRAFTENV_BASE_PATH')
    ],
    // Custom site-specific config settings
    'custom' => [
        'craftEnv' => getenv('CRAFTENV_CRAFT_ENVIRONMENT'),
        'staticAssetsVersion' => 1,
    ]
],

Why wont my local site show the dev mode settings in CP ?

  • Are you using .env or are you using .env.php? If the former, you want the constant to be: ENVIRONMENT="local" – andrew.welch Aug 6 '18 at 17:50
  • .env for sure (was using env.php but had some issues). Have disabled SEOmatic and other plugins but it looks like it never reads .env. I just had it working if devMode is tru in global so its missing my 'local' config section.. – joomkit Aug 6 '18 at 17:54
  • ENVIRONMENT="local" solved it - ThankYou! – joomkit Aug 6 '18 at 18:00
  • @joomkit Can you add your solution as an official answer in case it ends up helping someone in the future? – Brad Bell Aug 6 '18 at 18:54
2

The solution was ENVIRONMENT="local" in .env via andrew.welch

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.