Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

257
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda