Shuyinsama

Experience

1,620

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 15 Lessons Completed
  • 1 Favorite

13th October, 2017

Shuyinsama left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

We sort of traced it to a call in our AppServiceProvider.php file.

Somehow the CLI was throwing an error because we call to the session() function. We check if the current config is set to a language that supports RTL language and set a session based on that. If not then we forget the session.

The code is as follows:

if (config('locale.languages')[config('app.locale')][2]) {
    session(['lang-rtl' => true]);
} else {
    session()->forget('lang-rtl');
}

It was changed now to the following. Which only throws the error on the browser now but we are able to set the key now:

if (! app()->runningInConsole()) {
    if (config('locale.languages')[config('app.locale')][2]) {
        session(['lang-rtl' => true]);
    } else {
        session()->forget('lang-rtl');
    }
}

I am not entirely sure if this the entire problem and maybe it goes deeper but it solves the issue for now.

Shuyinsama left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

I have yes. I also tried changing the cipher to AES-128-CBC

I mean I could set the APP_KEY= in the .env.example to always come with a predefined key cause then a php artisan key:generate works and makes a new key.

But that wouldn't be very safe for the people who download the project.

Shuyinsama left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

Also no luck

I tried APP_KEY= I tried APP_KEY=null

both throw the same error

Shuyinsama left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

Thanks for trying to help though!

Shuyinsama left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

Did that too.. No luck. Same error.

Shuyinsama left a reply on Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

I do that and it gives the exact same error

Shuyinsama started a new conversation Fresh Install Error: "No Application Encryption Key Has Been Specified," • 1 month ago

I have a project that has a .env.example file.

The file is setup correctly as it has been working in previous version like so but since a couple of days all installs return this error

"No application encryption key has been specified,"

It's because the KEY= is empty. Whenever I copy over a key from another project and do php artisan key:genereate it works again.

here is the full .env.example file

APP_NAME="Laravel 5.5"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_LOCALE_PHP=en_US

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

# Access
ENABLE_REGISTRATION=true
REQUIRES_APPROVAL=false
CONFIRM_EMAIL=true
CHANGE_EMAIL=false

# Get your credentials at: https://www.google.com/recaptcha/admin
REGISTRATION_CAPTCHA_STATUS=false
NOCAPTCHA_SITEKEY=
NOCAPTCHA_SECRET=

# Socialite Providers
#FACEBOOK_ACTIVE=false
#FACEBOOK_CLIENT_ID=
#FACEBOOK_CLIENT_SECRET=
#FACEBOOK_REDIRECT=

#BITBUCKET_ACTIVE=false
#BITBUCKET_CLIENT_ID=
#BITBUCKET_CLIENT_SECRET=
#BITBUCKET_REDIRECT=

#GITHUB_ACTIVE=false
#GITHUB_CLIENT_ID=
#GITHUB_CLIENT_SECRET=
#GITHUB_REDIRECT=

#GOOGLE_ACTIVE=false
#GOOGLE_CLIENT_ID=
#GOOGLE_CLIENT_SECRET=
#GOOGLE_REDIRECT=

#LINKEDIN_ACTIVE=false
#LINKEDIN_CLIENT_ID=
#LINKEDIN_CLIENT_SECRET=
#LINKEDIN_REDIRECT=

#TWITTER_ACTIVE=false
#TWITTER_CLIENT_ID
#TWITTER_CLIENT_SECRET
#TWITTER_REDIRECT=
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.