8000 `.env` file is not loaded sometimes · Issue #756 · roots/bedrock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
.env file is not loaded sometimes #756
Open
@tysian

Description

@tysian

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

  1. Install Bedrock
  2. Add external db credentials in .env file
  3. Go to "create new post" admin page
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0