.env file size 0 after initial setup page

Hi.

I have Ubuntu 20.04, Apache2, PHP PHP Version 7.3.27-9

I followed step by step instructions here:

Added write permission to the folders:
sudo chown www-data:www-data /var/www/invoice-ninja/ -R
sudo chmod 755 /var/www/invoice-ninja/storage/ -R

The initial page shows well. I set up the database and test it with success.
After submitting the database gets created, but .env has 0 bytes. page showing:
Error: app is already configured, backup then delete the .env file to re-run the setup:”

I’m sure it’s a simple permission issue, but not sure what exactly. Can you please suggest the fix?

Thank you
Br,
Dali

On second thought it creates .env file, therefore the write permissions must be OK.

Really stuck here for hours.

Thank you
Br,
Dali

Un update.

Now I fixed the issue with permissions. It will create .env with data I submit, but will not load the login page right after.

This page isn’t working

invoice.abc.com is currently unable to handle this request.
HTTP ERROR 500

Hey there, can you please check the logs? They’re located in: /storage/logs/laravel.log

Thank you Ben

It looks its SQL authentication problem. Will look into it.

[2021-03-28 11:31:10] production.ERROR: Doctrine\DBAL\Driver\PDOException [2054] : /var/www/invoice-ninja/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php [Line 47] => SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36”,“locale”:“en”,“ip”:“192.168.6.236”,“count”:61,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“setup”} []

Thank you Ben for pointing out to laravel logs

Yes, it was mysql authentication problem. I was doing downgrade from 7.4 to 7.3 and it seems they changed authentication method.

I had to change mysql user to SHA256 password authentication.

Br,
Dali

Great, happy you solved it :v: