You have to specify your problem a bit more!
As far as I understand it, you have a systematic mistake (a enless loop e.g.). This couldn\'t be solves through PHP, you have to check your script.
You can recognize such issues easily, when you encounter a message like:
\"maximum script execution time has exceeded\"
(Default is 30Seconds)