我使用facebook php sdk上传照片,即使我有set_time_limit(0);
Fatal error: Uncaught exception 'Facebook\FacebookSDKException' with message 'Operation timed out after 60000 milliseconds with 0 bytes received' in E:\Local server\htdocs\localhost\lib\Facebook\HttpClients\FacebookCurlHttpClient.php:142 Stack trace: #0 E:\Local server\htdocs\localhost\lib\Facebook\FacebookRequest.php(248): Facebook\HttpClients\FacebookCurlHttpClient->send('https://graph.f...', 'POST', Array) #1 E:\Local server\htdocs\localhost\upload.php(102): Facebook\FacebookRequest->execute() #2 {main} thrown in E:\Local server\htdocs\localhost\lib\Facebook\HttpClients\FacebookCurlHttpClient.php on line 142
答案 0 :(得分:0)
此时间限制来自php.ini文件。但是使用facebook api最好有时间限制,默认安装30秒,因为没有必要 - 0 - 没有时间限制。但是问题是你必须捕获FacebookSDKException异常,所以用try catch块包装你调用函数