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

221
Views
PHP does not respect the maximum execution time set

I am running scripts that last longer than the limit allowed by the server and the server does not terminate them.

The phpinfo() showed me that the max_execution_time is set to 30. Using the ini_get('max_execution_time') feature the value 30 is displayed, but I put the code with sleep(45) and it runs until the end.

I also tried decreasing the time with ini_set('max_execution_time', 15), but still the code runs normally with sleep(45).

I've used sleep for testing purposes, but this is with functions that use cURL or even foreach and while that are used to create files for users.

What could be changing the server's maximum execution time?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

"The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), the sleep() function, database queries, etc. is not included when determining the maximum time that the script has been running."

Copied from: sleep().

In other words: Sleep() was a bad choice for testing maximum execution time.

over 4 years ago · Santiago Trujillo Report
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!