tags:

views:

90

answers:

3

Anyone got a problem with php 5.2.12 getting a lot of " Maximum execution time" error when trying to include() files?

I can't seem to find the bug in php.net, but it's consistently giving us that error on numerous scripts.

Anyone can recommend solutions?

The same script runs on a few other servers with php 5.2 without any problems. So just to let you guys know it isn't a script problem.

+1  A: 

I would check to make sure the same include isn't getting requested time and time again somehow. You might try include_once() just to see if it changes things for you. That isn't a solution so much as it's a potential temporary fix. You should find out what is causing this if indeed it is getting called over and over again.

Jonathan Sampson
A: 

If you have xdebug setup and an IDE that supports debugging this would be a great way to dig into the code. Otherwise, can you try putting some output statements in the first line of the included file and in the line PROIR to calling the include. See what's going on ...

Mr-sk
+3  A: 

This is much, much more likely to be a problem with your code rather than with a specific version of PHP. PHP by default has a maximum execution time of 30 seconds, which you can modify by calling set_time_limit() or adjusting your php.ini settings.

If you're not doing something that you expect to take a long time, then usually the cause of this error is an infinite loop somewhere in your code. I'd throw a debug_print_backtrace() and a couple of exit() calls into some key locations and try to figure out which file is giving you grief, and then take a closer look in there. Perhaps you're stuck in an infinite include() hierarchy, in which case you should be using include_once() for all your class and function library files.

zombat