Open
Description
Version
1.26.0
What did you expect to happen?
Read all env values from .env
file.
What actually happens?
Environmental variables are not loaded from .env
file and DB_HOST
value fallbacks to localhost
. "Error establishing a database connection" is thrown. Need to refresh a couple of times to open desired page. It happens like 33% times when navigating through the wp admin.
I've found a workaround by reverting this #598 PR.
Steps to reproduce
- Install Bedrock
- Add external db credentials in
.env
file - Go to "create new post" admin page
- Refresh it a couple of times
System info
Windows 10 Professional
Laragon 5.0.0
Apache httpd 2.4.35 VC15
PHP 8.1.3
MySQL 8.0.33-25 (external database)
Log output
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at localhost could not be established. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.
Please confirm this isn't a support request.
Yes