2 Replies Latest reply on Jun 20, 2016 3:56 PM by smashsplash

    PHP Fatal error: Maximum execution time of 30 seconds exceeded

    smashsplash

      If the server haven't been used for a few minutes the following error is thrown:

       

      PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\php\FileMaker\Implementation\FileMakerImpl.php on line 373

       

      However if i try the same request just after receiving the error, the server works fine. It looks like this happens after a minute or so without any requests.

        • 1. Re: PHP Fatal error: Maximum execution time of 30 seconds exceeded
          Chris Irvine

          Hi Smash,

           

          This probably isn't a FileMaker specific problem. Web served PHP has a safety valve that keeps scripts from running indefinitely and consuming all the computational resources of your web server. The default time limit for a PHP generated page request is 30 seconds. Check out PHP: set_time_limit - Manual to increase the limit.

           

          As far as the intermittent behavior, it is quite possible that you have a slow database query or script that, when starting cold, goes over the time limit. If you run the same query moments later, it typically takes less time because of caching that automatically happens in FMS and the operating system.

           

          There might also be something sluggish about your server setup. If using a HDD, make sure the drives are not sleeping. You might be waiting a few seconds for a drive to spin up after going into a low power mode. Even better would be using SSDs on your server. Beyond that, work on tuning your script or query so that it doesn't take so long to run.

           

          -Chris

          • 2. Re: PHP Fatal error: Maximum execution time of 30 seconds exceeded
            smashsplash

            As you mention it looks like the server goes into some kind of idle/sleep state.

             

            It doesn't matter what kind of query I run as long as it happens at least every minute. Even when i change the query the server responds fast. So i don't think it has anything to do with the cache.

             

            Is this a typical config error on the IIS webserver?