【问题标题】:Getting 500 internal server error on Foursquare appFoursquare 应用程序出现 500 内部服务器错误
【发布时间】:2016-12-15 09:29:44
【问题描述】:

我在 Foursquare 应用上收到“500 internal server error”。 在服务器端,错误日志文件存在超时错误:

PHP 警告: file_get_contents(https://api.foursquare.com/v2/users/self?oauth_token=XXXXXXX & a m p ; v=20161129): 无法打开流:连接超时

file_get_contents 中的“ & 正在转换为 & a m p ;” 很奇怪

顺便说一句,本地没有问题。问题是什么?代码,我的主机还是 Block by Foursquare ? 谢谢。

【问题讨论】:

  • Connection timed out 是网络问题,不是吗?
  • 是的。但是在本地应用上没问题。

标签: php api file-get-contents foursquare connection-timeout


【解决方案1】:

很可能您的服务器无法连接到外部资源,例如,因为firewall restrictions

尝试使用cURL,它为您提供比file_get_contents更多的选择和控制

或者它可能是执行问题。在文件获取内容之前尝试ini_set('max_execution_time', 300);...

【讨论】:

    最近更新 更多