Search code examples
phpwordpresscapistrano

Dotenv not loaded when deploying Bedrock-Capistrano


I'm doing my first Bedrock multisite install using bedrock-capistrano.

Everything works locally, however once deployed, I get

Warning: mysql_connect(): Access denied for user 'nobody'@'localhost' (using password: NO) in <snip>/releases/<snip>/public/wp/wp-includes/wp-db.php on line 1474

Obviously I did set this info in my .env file, and nobody with no password isn't the information I set ;) . I have checked that the env file is properly located; and it is. I have no other logs or error shown. Somehow it feels like it's not accessing the info properly.

Any ideas why could the dotenv not work?


Solution

  • bedrock-capistrano, which was supposed to run composer install as part of the deployment, did not do it as expected.

    Connecting to the server over SSH and running composer install manually did the trick to get dotenv to work.

    (Now the issue is "why did composer not work", but that's something else entirely)