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,
));
A much better solution would be to follow the answer listed on the following answer to Twitter API returns NULL on XAMPP which states that you should update the CA root certifications for your PHP solution.
For more information:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With