doubt about Maximum execution time

1

Well, I have a system that runs in php, and in it I have several functions. As it is a networked system several people use it at the same time. However, I started to receive the following error log:

PHP Fatal error:  Maximum execution time of 30 seconds

From what I noticed, I can increase the limit in PHP.ini

But my question is as follows, and does this normal error happen by tarting multiple users using? increase the limit and a gambiarra or has to be done as you have more users?

    
asked by anonymous 02.12.2016 / 16:11

1 answer

3

Add set_time_limit(0); to the top of the script that is experiencing the problem

  

The documentation says that with safe mode this does not work, but if your php is up to date it may not even exist anymore safe mode , since it is obsolete since PHP 5.3 and was removed in PHP 5.4, then set_time_limit(0); will work, unless the server administrator blocks this function

I do not think it's a good fit for php.ini because the 30 seconds are useful for me to avoid "bottlenecks."

Question:

  

But my question is as follows, and does this normal error happen by tarting multiple users using?

Answer:

It does not have to look directly, this is probably something in your script, if it accesses an external service and the service takes time (like a webservice or a database) this can occur, but generally the increase is a few seconds, if the problem is occurring is because the script has already spent more than it should and the influence of many hits only affects because the script is "badly written" (do not mischief)

Documentation: link

    
02.12.2016 / 16:18