开发者

time of 30 seconds exceeded error? file get contents

i have this error:

   Fatal error: Maximum execution time of 30 seco开发者_高级运维nds exceeded in C:\AppServ\www\facebook\classes\burccek.class.php on line 56

(im using file_get_contents)

(in this program i post file_get_contents data to facebook user wall(offline_access))


It means the file_get_contents operation takes more time that the max execution time of PHP. If you need a longer time, add this line at the top of your file: set_time_limit($seconds);

However 30 seconds seems a long time already so there might be some other issue with your application.


If duration of posting file to FB is longer than 30s (default maximum execution time of php script), use

set_time_limit ( 120 );

(or more in seconds) before executing file_get_contents


When posting data to other URLs, you should rely on CURL or even in extreme case may go to socket level. Curl has better control on connection time outs to handle network latency, much more set of options. In some hosting environments or servers a sys admin may restrict what all php.ini settings you can change, though you can change set_time_limit


You can change your set_time_limit in your php.ini file to alter the maximum execution time that php can use for a script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜