我正在使用专用服务器。1Gbps 端口。
有以下代码(与facebook连接)
if($_POST['friend_id'] != 0) {
$query = "SELECT uid, first_name, pic, sex FROM user WHERE uid = ".$_POST['friend_id'];
}
else {
$query = "SELECT uid, first_name, pic, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me() order by rand() limit 1)";
}
$query = urlencode($query);
$fql_query_url = 'https://graph.facebook.com/'. 'fql?q='.$query. '&access_token=' . $access_token;
$response = $facebook->api("/fql?q=$query");
$data = $response['data'];
然后我使用 uid 来获取用户的照片。
$img = file_get_contents('https://graph.facebook.com/'.$friend_id.'/picture?type=normal');
$imagesurse1 = $friend_id.uniqid().'.jpg';
file_put_contents($imagesurse1, $img);
$img = file_get_contents('https://graph.facebook.com/'.$user_id.'/picture?type=normal');
$imagesurse2 = $user_id.uniqid().'.jpg';
file_put_contents($imagesurse2, $img);
这些代码需要 10 秒到 xx 秒。xx 达到了 60。可能是什么问题。
它是一个网站应用程序。网站没有“https”