0

I encounter an error when I try to deploy with php deployer. Here is the error that I meet:

Extracting archive - Installing symfony/web-link (v4.1.4): Loading from cache
Extracting archiveGenerating optimized autoload files
post-install-cmd: @auto-scripts
Executing script cache:clear
Executed script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! PHP Fatal error: Uncaught RuntimeException: APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a
Composer dependency to load variables from a .env file. in /home/projet/www/beta/releases/1/bin/console:20
!! Stack trace:
!! #0 {main}
!! thrown in /home/projet/www/beta/releases/1/bin/console on line 20
!!

Should we configure something more to deploy in prod and dev?

Thank you for help.

Chris99391
  • 551
  • 1
  • 6
  • 18
  • You need to either set environment variables on your server, or create an `.env` file in your project root (and install symfony/dotenv as described). The docs should cover what you need to know - I recommend reading the relevant docs and familiarise yourself with your options. – Darragh Enright Sep 14 '18 at 22:44
  • This is probably a good starting point: https://symfony.com/doc/current/configuration.html – Darragh Enright Sep 14 '18 at 22:45
  • I wish I could do this dynamically how to do it if I have to go through the server? thank you – Chris99391 Sep 15 '18 at 08:44
  • I am not sure what you mean by dynamically - can you elaborate? – Darragh Enright Sep 15 '18 at 18:42
  • I use deploy php to deploy my project to have 2 environments dev and prod. I was able to solve the problem above but now I have another problem when I'm in production. When my variable APP_DEBUG = 1 my production environment is working and when APP_DEBUG = 0 I have an error 404 Not found – Chris99391 Sep 15 '18 at 18:48

0 Answers0