Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

379
Visualizações
Symfony DotEnv PathException

I have a second issue. I run Symfony with api-platform in a Docker Container. However, this container's PHP keeps crashing. This particular issue happens when I run docker-compose up --build (So with the --build flag). The following error occurs, after which PHP exits with code 255.

#54 2.503 Script cache:clear returned with error code 255
#54 2.503 !!  PHP Fatal error:  Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/srv/api/.env" environment file. in /srv/api/vendor/symfony/dotenv/Dotenv.php:505
#54 2.503 !!  Stack trace:
#54 2.503 !!  #0 /srv/api/vendor/symfony/dotenv/Dotenv.php(60): Symfony\Component\Dotenv\Dotenv->doLoad()
#54 2.503 !!  #1 /srv/api/vendor/symfony/dotenv/Dotenv.php(80): Symfony\Component\Dotenv\Dotenv->load()
#54 2.503 !!  #2 /srv/api/config/bootstrap.php(17): Symfony\Component\Dotenv\Dotenv->loadEnv()
#54 2.503 !!  #3 /srv/api/bin/console(30): require('/srv/api/config...')
#54 2.503 !!  #4 {main}
#54 2.503 !!    thrown in /srv/api/vendor/symfony/dotenv/Dotenv.php on line 505
#54 2.503 !!

After looking stuff up and three days worth trying to debug this issue I came across a few supposed solutions. On StackOverflow I only found one, which stated that Symfony requires an .env file and the person asking should create one. Fun thing: The .envfile does exist. It is there, and was always working up until now. (Clean Factory Reset on Machine)

I checked permissions outside the srv folder for all the .env files, and they are read- and writeable. I'm not sure how to do this in the srv folder. But the thing is, I don't understand what the issue is at all. The error message seems pretty simple, but does not tell me what's going on.

Any suggestions on what the cause is and how to resolve this issue?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda