Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!