Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matttonks11's avatar

5.8 Testing Issue - No application encryption key has been specified.

Hi there,

I'm running into an issue when I install a new 5.8 project and run phpunit.

I get the following error...

1) Tests\Feature\ExampleTest::testBasicTest
RuntimeException: No application encryption key has been specified.

However I can visit the app in the browser and it doesn't throw the same error which it would do if the encryption key didn't actually exist.

Also if I run the command in a project that uses 5.7 it works fine and even if I install a fresh version of 5.7 using

composer create-project laravel/laravel="5.7.*" myProject

everything works fine.

Has anyone got any ideas or encountered this situation and could provide some guidance?

0 likes
1 reply

Please or to participate in this conversation.