PHP file_get_contents超过了最大执行时间(是否引起表情?) [英] PHP file_get_contents Maximum execution time exceeded (Cause of emotes?)
问题描述
不久前,我开始弄乱Steam API,并使用GetPlayerSummaries方法创建了一个显示个人资料信息的简单网站.一直很好,直到我的一些朋友开始以他们的名字添加iOS emotes为止,这会导致以下情况:
I started messing around with the Steam API a bit ago, and I made a simple site showing profile information using the GetPlayerSummaries method. It's been working great, right until some of my friends started adding iOS emotes in their name, which causes the following:
致命错误:在第137行的文件中,最长执行时间超过了300秒
Fatal error: Maximum execution time of 300 seconds exceeded in file on line 137
这是文件中该行的内容:
This is what's on that line in the file:
public function getPlayerSummary($steamid) {
$contents = file_get_contents( "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".SteamAPI_APIKey."&steamids=".$steamid );
$json = json_decode($contents, true);
foreach($json['response']['players'] as $key => $value) {
...
}
}
(这在函数中,调用该函数时定义了$ steamid)
(This is in a function, $steamid is defined when calling the function)
这应该返回(JSON):
This should return (JSON):
这篇关于PHP file_get_contents超过了最大执行时间(是否引起表情?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!