<blockquote>
  <p>If I change the mode to "production" from "dev," the errors go away,
  and as far as I can see no new error is created in the server or Craft
  log. So I can develop in production mode but I do find the dev mode
  useful.</p>
</blockquote>

<p>It sounds like you're changing the environment variable <code>ENVIRONMENT</code>, e.g.:</p>

<pre><code>ENVIRONMENT="dev"
</code></pre>

<p>This actually doesn't do much, it's just an arbitrary name for the environment that Craft is running in. You could call it <code>fluffybunny</code> and no one would mind. The only thing it affects is what settings might be used in you multi-environment config files like <code>config/general.php</code>.</p>

<p>I'd suggest reading over the <a href="https://nystudio107.com/blog/multi-environment-configuration-for-craft-cms-3" rel="nofollow noreferrer">Flat Multi-Environment Config for Craft CMS 3</a> article</p>

<p>Also for log file reading, the article <a href="https://nystudio107.com/blog/zen-and-the-art-of-craft-cms-log-file-reading" rel="nofollow noreferrer">Zen and the Art of Craft CMS Log File Reading</a> may be useful as well.</p>

CC BY-SA 4.0
2020-03-15T02:27:15.277Z
I am changing the `ENVIRONMENT` variable, but I guess I should clarify what it's doing is turning `devMode` off. My `config/general.php` is untouched from Craft's defaults, which sets `devMode` to "true" with an `ENVIRONMENT` set to "dev".
Roger Wilco
CC BY-SA 4.0
2020-03-14T11:11:58.443Z
2020-03-14T11:11:58.443Z
andrew.welch
<p>I'm running into a vexing issue while developing a personal site in Craft. I have a new Craft 3 site, installed manually. I'm developing live on the server in a dev subdomain. My <code>.env</code> sets the site to "dev" mode. </p>

<p>It's been awhile since I've worked on a front-end; one thing that's been an issue is either Safari or Craft caches the CSS while I'm coding. To prevent the cache from loading I've used the "ignore the resource cache while loading resources" button in the Network pane of the Webkit inspector. A few times after reloading the page, I begin to get server errors. The server errors are yii exceptions for a missing template of <code>internal_error.html</code>, which suggests a server error and not a Craft error specifically.</p>

<p>I've searched through the logs and although I can see where Craft throws the exception, I can't see what is causing this. The headers on my network simply say that the main site URL is throwing a 404. My server log says:</p>

<blockquote>
  <p>[Thu Mar 12 11:29:11.886937 2020] [core:error] [pid 28286] [client
  xx.xxx.xx.xxx:xxxxx] End of script output before headers: index.php</p>
</blockquote>

<p>Thinking this might be a permissions issue I started from scratch with a Composer-installed Craft. All was fine until I used the cache button on the Network pane again, and the errors returned.</p>

<p>If I change the mode to "production" from "dev," the errors go away, and as far as I can see no new error is created in the server or Craft log. So I can develop in production mode but I do find the dev mode useful.</p>

<p>I've manually cleared the cache from <code>storage/runtime</code> and cleared the generated files in <code>cpresources</code>. I've also cleared the cache from the backend admin when logged in via production mode. This doesn't have any effect.</p>

<p>I should add the only thing I haven't tried is to disable Safari's caches while running the site in production mode; if it's related I don't want to break the only method I have on working on the site.</p>

<p>Any help here is greatly appreciated! </p>

<craft3><error>
Disabling caches in Safari results in server errors while developing Craft 3 site
# Disabling caches in Safari results in server errors while developing Craft 3 site

(Asked by: username_0 on 2020-03-12)

I'm running into a vexing issue while developing a personal site in Craft. I have a new Craft 3 site, installed manually. I'm developing live on the server in a dev subdomain. My `.env` sets the site to "dev" mode.

It's been awhile since I've worked on a front-end; one thing that's been an issue is either Safari or Craft caches the CSS while I'm coding. To prevent the cache from loading I've used the "ignore the resource cache while loading resources" button in the Network pane of the Webkit inspector. A few times after reloading the page, I begin to get server errors. The server errors are yii exceptions for a missing template of `internal_error.html`, which suggests a server error and not a Craft error specifically.

I've searched through the logs and although I can see where Craft throws the exception, I can't see what is causing this. The headers on my network simply say that the main site URL is throwing a 404. My server log says:

> [Thu Mar 12 11:29:11.886937 2020] [core:error] [pid 28286] [client
> xx.xxx.xx.xxx:xxxxx] End of script output before headers: index.php

Thinking this might be a permissions issue I started from scratch with a Composer-installed Craft. All was fine until I used the cache button on the Network pane again, and the errors returned.

If I change the mode to "production" from "dev," the errors go away, and as far as I can see no new error is created in the server or Craft log. So I can develop in production mode but I do find the dev mode useful.

I've manually cleared the cache from `storage/runtime` and cleared the generated files in `cpresources`. I've also cleared the cache from the backend admin when logged in via production mode. This doesn't have any effect.

I should add the only thing I haven't tried is to disable Safari's caches while running the site in production mode; if it's related I don't want to break the only method I have on working on the site.

Any help here is greatly appreciated!

**Tags:** craft3, error

---

## 1 answers

### Answer by username_1 on 2020-03-14. Score: 1

If I change the mode to "production" from "dev," the errors go away,
  and as far as I can see no new error is created in the server or Craft
  log. So I can develop in production mode but I do find the dev mode
  useful.

It sounds like you're changing the environment variable ENVIRONMENT, e.g.:
ENVIRONMENT="dev"

This actually doesn't do much, it's just an arbitrary name for the environment that Craft is running in. You could call it fluffybunny and no one would mind. The only thing it affects is what settings might be used in you multi-environment config files like config/general.php.
I'd suggest reading over the Flat Multi-Environment Config for Craft CMS 3 article
Also for log file reading, the article Zen and the Art of Craft CMS Log File Reading may be useful as well.

> **Comments:**
> **username_0**: I am changing the `ENVIRONMENT` variable, but I guess I should clarify what it's doing is turning `devMode` off. My `config/general.php` is untouched from Craft's defaults, which sets `devMode` to "true" with an `ENVIRONMENT` set to "dev".  

---

