0
我试图使用Geocaching.com API服务访问用户信息。使用下面的script我得到下面提到的错误:PHP geocaching API curl问题
如果我使用“开箱的”(活动服务器上)我得到以下信息:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/mrmemeco/public_html/geo/src/Geocaching/OAuth/OAuth.php on line 329
Fatal error: Uncaught exception 'Exception' with message '28' in /home/mrmemeco/public_html/geo/src/Geocaching/OAuth/OAuth.php:334 Stack trace: #0 /home/mrmemeco/public_html/geo/src/Geocaching/OAuth/OAuth.php(206): Geocaching\OAuth\OAuth->curl_request('http://staging....') #1 /home/mrmemeco/public_html/geo/index.php(50): Geocaching\OAuth\OAuth->getRequestToken() #2 {main} thrown in /home/mrmemeco/public_html/geo/src/Geocaching/OAuth/OAuth.php on line 334
如果我用它以相同的方式,但在本地主机上取回HTTP错误:0并且不返回任何数据。
我已经做了一些谷歌搜索,我检查了安全模式关闭,但我仍然没有喜悦。
这绝对不是我的API密钥,因为他们在现场demo
感谢您的回复,我试过所有的建议,我仍然得到相同的错误 – jampez77
好吧,而不是改变这个值也许最好是简单地禁用cUrl选项'FOLLOWLOCATION'。尝试编辑'/ src/Geocaching/OAuth/OAuth.php'文件并将第328行更改为'curl_setopt($ ch,CURLOPT_FOLLOWLOCATION,TRUE);',然后查看脚本是否正在工作 –
FOLLOWLOCATION设置为FALSE我得到:致命错误:带有消息“未能连接到主机”的未捕获的异常'异常'in。将FOLLOWLOCATION设置为TRUE时,我得到与以前相同的CURLOPT_FOLLOWLOCATION警告和相同的错误消息...致命错误:未捕获异常'异常'消息'无法连接到主机'中 – jampez77