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

218
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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