Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • 4
    The makers of phpdotenv (the lib Craft 3 uses to load .env files) warn against using it in production because of the overhead it adds to load the file on every request. It’s debatable if the “.env.php way” improves this situation in a measurable dimension. If you are really that much worried about performance in this order of magnitude (fractions of 1ms), you should better stick to getenv() and set the env variables on production servers via the server configuration files. Commented Apr 13, 2018 at 13:29