Jump to content

Maximum Execution Time

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
I am doing a PHP script that pulls a ton of data from two different database tables. While executing the script I receive a Fatal Error: Maximum execution time exceeded 30 seconds. Is there a way to fix this? Is the way I am pulling the data from the DB causing this or is it because of so many results?

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Well I believe the execution time has to do with the webserver configuration file itself. If you have access to the configuration files you can change the max execution time.

But 30 seconds for 1 query is extremly long, are you sure you havnt created an infinate loop?

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Increase this value in your php.ini

max_execution_time = 30

It wasn't in my php.ini so in that case just add it. The 30 represents the amount of seconds it will wait.

#4
Guest_Jonas_*

Guest_Jonas_*
  • Guests
Do you have control of your server? If not, most shared hosts put a very low limit on that number to make scripts friendlier to share.

If it is something you can't change, one workaround it is to break up whatever you are doing in segments so it does not timeout in any indivual segment.

I know a few scripts that get around this problem by doing that.

#5
smith

smith

    Programmer

  • Members
  • PipPipPipPip
  • 153 posts

Jonas said:

Do you have control of your server? If not, most shared hosts put a very low limit on that number to make scripts friendlier to share.

If it is something you can't change, one workaround it is to break up whatever you are doing in segments so it does not timeout in any indivual segment.

I know a few scripts that get around this problem by doing that.


Yup, that is a good idea. You can limit the amount of data that is pulled at once and have << Prev and Next >> buttons to pull the next amount of data.

for (int i;;) {

   cout << "Smith";

}