Closed jamesmacwhite closed 3 years ago
@jamesmacwhite maybe its worth looking at the code where Craft calls dotenv and adding it to the console file that loads PHP? Its been a really long time since I looked at Craft 2 but I will try to dig up an installation and ask someone on the team if they have the same issue.
@jasonmccallister Ah, having a minor brain failure. Yes, I can just include the vendor and DotEnv load in my console/yiic before it's called. I assume previously the env vars have been available without this, but because of the Docker container being split, the env vars aren't set in the PHP container.
Don't worry, I think I have a fix, thanks!
Description
This is a probably a bit of unique case, but for Craft 2 calling console/yiic under Nitro doesn't work, as it cannot connect to the database. I am using environment variables in the config/db.php but I don't believe the environment variables are available to the console request, as all the db parameters are blank. If I hard code this in the db.php it works:
The environment variables do work for web requests however.
Is there anything that can be done, other than hard coding?