:linked_files('.env') is hidden directory instead of actual file, leading to 404

I am having a weird issue with deploying bedrock using Capistrano, and so I want to outline the issue first, and then hopefully, I will comment the solution later on.

I am using roots/bedrock-capistrano to deploy a roots/bedrock project on a shared web host, Hostinger. There are 0 tables in the database at the moment, meaning WordPress needs to be installed.

Background

  • The deployment successfully completed without errors. All the necessary folders are present on the server.
  • I used SFTP to upload the filled-out .env file to my shared folder.
  • The public_html symlink is pointing correctly to the current/web release thanks to a custom deployment task.
  • I am using this line exactly as provided by roots:
set :linked_files, fetch(:linked_files, []).push('.env')

However, there is an issue: My domain redirects to 404 at all levels, even at http://example.com/wp/wp-admin

My first instinct was that the database credentials were wrong; however, I was able to remotely connect to my database using MySQL Workbench without issue. The database credentials are not the issue.

I listed out the file contents of the /current/ directory using SSH, and noticed that .env was missing. To double-check, I opened my SFTP client, and noticed that .env is present; however, it is a hidden directory instead of a file. Hopefully these images show the issue:

SFTP shows .env as folder:
env_as_directory_instead_of_file

SSH missing .env:

To resolve this, I changed deploy.rb to symlink /current/web folder and the domain’s correct DocumentRoot: /home/username/domains/domain.com/public_html

(not /home/username/public_html because I have more than one domain)

The FTP client sleuthing was irrelevant and wrong; the .env file is present, as can be seen in the SSH client with ls -a.

Made the add-on into a gist.
Please provide constructive feedback if you have any. I hope to improve.