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

256
Visualizações
How to trigger a PHP fatal error when I kill a process?

I have a problem with a script that is freezing in about 1% of the times it runs, as described here.

To avoid a running more than once at a times, the script creates a temporary file, which gets deleted if the script finished or if a PHP fatal error occured.

When the script freezes, this does not happen of course, and so everything gets stuck, since the next scheduled run will not start, as the temporary file still exists.

No one has managed so far to figure why the script is freezing, so in the meantime I think to use a "dirty" solution, by having the system kill the script if it takes longer than expected, which might mean it froze.

I can do it by running it like timeout -s KILL 1m php script..php which kills it after a minute, if I assume it should have finished within a minute.

However, killing it this way does not solve the temporary file issue, and therefore I want to know if there is a way to both kill it and generate a fatal error for the script, so it will delete the temp. file

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