Soundcloud:请求的URL响应HTTP代码0 [英] Soundcloud: The requested URL responded with HTTP code 0

查看:345
本文介绍了Soundcloud:请求的URL响应HTTP代码0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的代码库从一个服务器移动到另一个 - 没有代码更改,唯一的区别是https。我在Soundcloud开发人员修改我的应用程序为 https:// url ,但是我不断收到此错误:

  [20-Sep-2013 15:08:35 Europe / London] PHP致命错误:未捕获异常Services_Soundcloud_Invalid_Http_Response_Code_Exception,带有消息请求的URL响应HTTP代码0 soundcloud / Soundcloud.php:945 
堆栈跟踪:
#0 /soundcloud/Soundcloud.php(298):Soundcloud-> _request('https://api.sou ...',Array )
#1 /application/controllers/speaker/media.php(190):Soundcloud-> credentialsFlow('soundcloud @ ...','073ffbc3b66691c ...')
#2 [internal函数]:Media-> add_audio()
#3 /system/core/CodeIgniter.php(359):call_user_func_array(Array,Array)
#4 /index.php(202):require_once '/ home / iwantasp / ...')
#5 {main}
抛出在/system/soundcloud/Soundcloud.php第945行
pre>

再次,此代码在以前的服务器上完美运行,只是服务器更改。



通常是导致此问题的原因的安全证书无效( Soundcloud(Oauth2) )API获取访问令牌失败) - 我们在一个linux系统反正不应该有什么区别。



cURL也可以在这个服务器上工作。



还有什么可能导致我的问题?

解决方案

调试此异常而不查看源代码。但我的猜测是,您的问题可能与此问题有关:



https://github.com/mptre/php-soundcloud/issues/3



这表示您应该修改 accessToken 调用并包含额外的cURL参数。

  $ accessToken = $ soundcloud-> accessToken($ code,$ postData,array(
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,


I moved my code base from one server to another - no code change, the only difference being https. I modified my app in Soundcloud developers to be https://url , however I continuously receive this error:

[20-Sep-2013 15:08:35 Europe/London] PHP Fatal error:  Uncaught exception 'Services_Soundcloud_Invalid_Http_Response_Code_Exception' with message 'The requested URL responded with HTTP code 0.' in /system/soundcloud/Soundcloud.php:945
Stack trace:
#0 /soundcloud/Soundcloud.php(298): Soundcloud->_request('https://api.sou...', Array)
#1 /application/controllers/speaker/media.php(190): Soundcloud->credentialsFlow('soundcloud@...', '073ffbc3b66691c...')
#2 [internal function]: Media->add_audio()
#3 /system/core/CodeIgniter.php(359): call_user_func_array(Array, Array)
#4 /index.php(202): require_once('/home/iwantasp/...')
#5 {main}
  thrown in /system/soundcloud/Soundcloud.php on line 945

Again, this code worked perfectly on the previous server, it's merely server change.

We have implemented the security cert that is usually the cause for this problem to no avail (Soundcloud (Oauth2) API getting access token fails) - we're on a linux system anyways so shouldn't make a difference.

cURL also works on this server.

What else could cause my problem?

解决方案

It's hard to debug this exception without seeing the source code. But my guess is that your problem might be related to this issue:

https://github.com/mptre/php-soundcloud/issues/3

Which means that you should modify your accessToken call and include the extra cURL parameters.

$accessToken = $soundcloud->accessToken($code, $postData, array(
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => false,
));

这篇关于Soundcloud:请求的URL响应HTTP代码0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆