It’s been a while but i got the same error again.
After Trellis/Bedrock deploy (or even just bedrock). I get a wordpress setup screen for creating the wp-config.php file. Now if i input the database name etc. I get wordpress working, but there is not a theme or plugins in there.
The thing i found out is that it’s not picking up the .env file and the reason for this is, that my deploy (git) was missing the web/wp-config.php file which has this code in it:
<?php
/**
* Do not edit this file. Edit the config files found in the config/ dir instead.
* This file is required in the root directory so WordPress can find it.
* WP is hardcoded to look in its own directory or one directory up for wp-config.php.
*/
require_once(dirname(__DIR__) . '/vendor/autoload.php');
require_once(dirname(__DIR__) . '/config/application.php');
require_once(ABSPATH . 'wp-settings.php');
This file helps loading the .env. Also if i go back to the setup screen problem, that wp-config.php (default wp one) will be created in web/wp.
I don’t know the reason why this happened, maybe .gitignore? I used the latest Trellis/Bedrock and if i check my github i only have app/ and index.php in there (no wp/ as this one is created with composer if i’m correct?). Local works fine.
This problem was haunting me for months hehe I know how to fix it (git add web/wp-config.php) but i have no idea why this happened a lot of times before.