Report this

What is the reason for this report?

The environment file is invalid: Dotenv values containing spaces must be surrounded by quotes

Posted on December 9, 2019

Hello everyone I need help regarding this error message: “The environment file is invalid: Dotenv values containing spaces must be surrounded by quotes”

I just finished setting up environment for my app according to the request of the wizard installer of the app. I input things like database credentials, mail credentials, google client ID and others. After that, upon visiting my website, I found this error. That made me to remember that when I was filling the forms, I spaced out my username when entering the mail credentials, so I don’t know if that is part of my problem now.

So, how do I access the Dotenv file according to the error instruction to check the files with spaces and correct them? OR Which command will I use to get rid of this once and for all?

In fact, how do I solve this problem?

Thanks, everyone. looking forward to hearing from you.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

Would you mind confirming which application exactly did you deploy? I can then confirm the exact location of the Dotenv file and the exact steps that you need to take to fix it.

But for example if you are using Laravel the default location of the .env file is at:

/var/www/html/.env

You need to open this file with your favorite text editor and find the username line:

nano /var/www/html/.env

Find the user name variable and add quotes around the value.

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.