Questions tagged [env]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
211 views

.env / config data not loading on repeated / simultaneous requests

I'm having this strange issue on php7.4 and php8.1 on windows11 (apache2.4) where my craft sites loose or fail to load the .env data on some requests and only when under load / handling requests in ...
3 votes
1 answer
454 views

DevMode set to true, but doesn't appear to work locally

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... <?php /** * General Configuration ...
1 vote
0 answers
624 views

craft\web\Request::cookieValidationKey must be configured with a secret key

For a while our Craft CMS webshop show errors in the control panel. This happens 25%-50% of the requests. Looking in the phperror log a lot of this errors are logged: [13-Dec-2021 23:00:05 UTC] An ...
1 vote
1 answer
2k views

Unable to use credentials.json from .env file for Google Cloud Storage

Setup Craft CMS: 3.5.19.1 PHP: 7.2.24 This setup is in process of being updated to the latest version. I'm thinking the issue reported here may already be solved but I can't find any information on it....
1 vote
1 answer
163 views

Siteurl - craft.app.request.absoluteUrl() output missing "www"

How can I add "www" to the output of {{ craft.app.request.absoluteUrl }}? In my .env file I have DEFAULT_SITE_URL="https://www.mysite.com" but {{ craft.app.request.absoluteUrl() }}...
1 vote
1 answer
209 views

Access env variables in custom php files

Craft Version 3.2 PHP Version 7.2 Below is my folder structure: Root - Other Craft Folder - Web - Services - Db.php - env file I want to read the connection string of the SQL ...
1 vote
1 answer
518 views

.env parsing error on Windows server

Has anyone had issues with Craft parsing a .env on Windows Server? Dotenv is throwing an exception (FileException - invalid name) when parsing the first line of my .env, which is just a comment. I ...
2 votes
1 answer
792 views

Site url is not generated correctly when using environment variables

I'm working on a multi-site setup (for a localized website). In my .env file, I have defined a SITE_BASE_URL variable. Then, in the control panel, I set up each site's base url with that environment ...