Artisan team says: Dotenv values ​​containing spaces should be surrounded by quotation marks

I am trying to find out the list of artisan command using php artisan list . and the command returns me the following error [Dotenv\Exception\InvalidFileException] Dotenv values containing spaces must be surrounded by quotes. What's wrong?

Thanks in advance.

+15
source share
4 answers

You must remove all spaces from the .env file for the application to work again.

If you need to use spaces instead:

 VAR=some data 

Use quotation marks:

 VAR="some data" 
+58
source

Check the .env file. You need to check the following:

  • Any additional or unnecessary spaces
  • If you have lines with spaces, make sure they are surrounded by quotation marks.

Example:

 varaible=123 Test 

Must be

 varaible="123 Test" 
+4
source

if you use two words for the username or database name in .env, put it in double quotes.

example

0
source

Check env first.

If your value is a variable with a space, check the value in double quotes. Like

  MAIL_FROM_NAME="Sarvajanik School" 

If you use single quotation marks, then a possible error containing spaces must be enclosed in quotation marks.

0
source

Source: https://habr.com/ru/post/1267196/


All Articles