Fatal error: Maximum execution time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
programec
Forum Newbie
Posts: 1
Joined: Sat Jun 05, 2010 1:05 am

Fatal error: Maximum execution time

Post by programec »

try {}catch(){} is not working for this ....
i donot want to increase time of executtion ...

Code: Select all

if($Content = file_get_contents($url,FALSE,NULL,0,10) //if successfully get content in 10 seconds
{
        run code ....
}
else if(time exceed by 10 second)then
{
         run this code 
}
how to do this ....
Last edited by Benjamin on Sat Jun 05, 2010 1:41 am, edited 2 times in total.
Reason: Added [syntax=php] tags.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Fatal error: Maximum execution time

Post by Benjamin »

:arrow: Moved to PHP - Code
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Fatal error: Maximum execution time

Post by Eran »

You should use cURL instead if you want to control the maximum timeout.

try-catch works for exceptions, not fatal errors.
Post Reply