My ddev environment always runs in production mode. How to change that?
SetEnv TYPO3_CONTEXT Development
My ddev environment always runs in production mode. How to change that?
SetEnv TYPO3_CONTEXT Development
Edit 2023-04-25: There are now many ways to set environment variables that don't require any of this. You can use a .ddev/.env
, or add an environment variable to web_environment
, etc. See https://ddev.readthedocs.io/en/latest/users/extend/customization-extendibility/#providing-custom-environment-variables-to-a-container
The answer by @marcel is better these days.
Original answer:
There's an easier way that doesn't involve such complexity.
Create a .ddev/docker-compose.typo3.yaml with these contents:
services:
web:
environment:
- TYPO3_CONTEXT=Development
This does nothing beyond adding that environment variable in the web container. Note that the name of the docker-compose file is not important, it could be docker-compose.envstuff.yaml
Just for those who stumble upon this question here.
In newer versions of ddev (I have v1.17.5), you have to edit the file .ddev/config.yml
with nano o.e.
You can just replace the line
web_environment: []
by
web_environment:
- TYPO3_CONTEXT=Development
Afterwards you have to restart the environment via ddev restart
you have to setup an individual nginx configuration. To do so:
that's it
I found the official ddev documentation page for this topic:
https://ddev.readthedocs.io/en/latest/users/usage/cms-settings/#setup-a-base-variant-since-typo3-95
I applied this in a local TYPO3 v12 project and it worked perfectly. So go to your .ddev folder and change the value for web_environment, like so:
web_environment:
- TYPO3_CONTEXT=Development/DDEV
After this change you need to restart your project:
ddev restart