[GH-ISSUE #32] Uncaught exception 'SpotifyWebAPI\SpotifyWebAPIException' #18

Closed
opened 2026-02-27 19:25:38 +03:00 by kerem · 13 comments
Owner

Originally created by @BillyCallahan on GitHub (Apr 30, 2015).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/32

Hello,

I think I'm having the same issue that https://github.com/jwilsson/spotify-web-api-php/issues/29.
Here's my error: 1430432140-spotify-error.png - envoi d'image avec NoelShack

So, when I launch index.php it asks me the authorization and when I say 'yes' I'm getting this.
I have an another page callback.php which is called once the user clicks on 'yes'.
These two pages only contain the code provided by you.
I tried to run it on both Linux and Windows :)

If you need anything, ask me !
Thanks in advance, it's really important for me to solve this problem 👍

Audric.

Originally created by @BillyCallahan on GitHub (Apr 30, 2015). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/32 Hello, I think I'm having the same issue that https://github.com/jwilsson/spotify-web-api-php/issues/29. Here's my error: <a href="http://www.noelshack.com/2015-18-1430432140-spotify-error.png"><img src="http://image.noelshack.com/minis/2015/18/1430432140-spotify-error.png" border="0" alt="1430432140-spotify-error.png - envoi d'image avec NoelShack" title="1430432140-spotify-error.png"/></a> So, when I launch index.php it asks me the authorization and when I say 'yes' I'm getting this. I have an another page callback.php which is called once the user clicks on 'yes'. These two pages only contain the code provided by you. I tried to run it on both Linux and Windows :) If you need anything, ask me ! Thanks in advance, it's really important for me to solve this problem :+1: Audric.
kerem closed this issue 2026-02-27 19:25:38 +03:00
Author
Owner

@jwilsson commented on GitHub (May 1, 2015):

Some code is appreciated :)

<!-- gh-comment-id:98072117 --> @jwilsson commented on GitHub (May 1, 2015): Some code is appreciated :)
Author
Owner

@BillyCallahan commented on GitHub (May 1, 2015):

Here it is :)
https://github.com/AudricManaud/SpotifyAPI

<!-- gh-comment-id:98085159 --> @BillyCallahan commented on GitHub (May 1, 2015): Here it is :) https://github.com/AudricManaud/SpotifyAPI
Author
Owner

@jwilsson commented on GitHub (May 1, 2015):

Thanks!

I think your problem lies in a mismatch between the callback URI you've registered at Spotify and the one you're actually using.

In the screenshot, the URL seems to be http://localhost/promus/callback.php but in the code you posted, the redirect URI is http://localhost/callback.php. Try changing one of them, either the registered URI at Spotify or move the files so they're placed where Spotify expects them.

<!-- gh-comment-id:98096659 --> @jwilsson commented on GitHub (May 1, 2015): Thanks! I think your problem lies in a mismatch between the callback URI you've registered at Spotify and the one you're actually using. In the screenshot, the URL seems to be `http://localhost/promus/callback.php` but in the code you posted, the redirect URI is `http://localhost/callback.php`. Try changing one of them, either the registered URI at Spotify or move the files so they're placed where Spotify expects them.
Author
Owner

@BillyCallahan commented on GitHub (May 1, 2015):

Owwh I'm sorry that's a previous screenshot, I corrected it and it's still doesn't work:
1430477107-spotify-error.png - envoi d'image avec NoelShack

<!-- gh-comment-id:98098680 --> @BillyCallahan commented on GitHub (May 1, 2015): Owwh I'm sorry that's a previous screenshot, I corrected it and it's still doesn't work: <a href="http://www.noelshack.com/2015-18-1430477107-spotify-error.png"><img src="http://image.noelshack.com/minis/2015/18/1430477107-spotify-error.png" border="0" alt="1430477107-spotify-error.png - envoi d'image avec NoelShack" title="1430477107-spotify-error.png"/></a>
Author
Owner

@jwilsson commented on GitHub (May 1, 2015):

Alright, I've tried reproducing it but I can't find anything wrong with it.

Could you dump the whole response by adding something like

print_r($response);

on line 126 of Request.php, right after the line

curl_close($ch);

and post the result here.

<!-- gh-comment-id:98143127 --> @jwilsson commented on GitHub (May 1, 2015): Alright, I've tried reproducing it but I can't find anything wrong with it. Could you dump the whole response by adding something like ``` print_r($response); ``` on line 126 of `Request.php`, right after the line ``` curl_close($ch); ``` and post the result here.
Author
Owner

@BillyCallahan commented on GitHub (May 1, 2015):

Weird, it doesn't display anything at all...
1430490339-spotify.png - envoi d'image avec NoelShack

1430490757-sublime-text.png - envoi d'image avec NoelShack

<!-- gh-comment-id:98144258 --> @BillyCallahan commented on GitHub (May 1, 2015): Weird, it doesn't display anything at all... <a href="http://www.noelshack.com/2015-18-1430490339-spotify.png"><img src="http://image.noelshack.com/minis/2015/18/1430490339-spotify.png" border="0" alt="1430490339-spotify.png - envoi d'image avec NoelShack" title="1430490339-spotify.png"/></a> <a href="http://www.noelshack.com/2015-18-1430490757-sublime-text.png"><img src="http://image.noelshack.com/minis/2015/18/1430490757-sublime-text.png" border="0" alt="1430490757-sublime-text.png - envoi d'image avec NoelShack" title="1430490757-sublime-text.png"/></a>
Author
Owner

@jwilsson commented on GitHub (May 1, 2015):

Hmm, try with

var_dump(curl_error($ch));

instead. But put it before the

curl_close($ch);

line.

<!-- gh-comment-id:98144709 --> @jwilsson commented on GitHub (May 1, 2015): Hmm, try with ``` var_dump(curl_error($ch)); ``` instead. But put it before the ``` curl_close($ch); ``` line.
Author
Owner

@BillyCallahan commented on GitHub (May 1, 2015):

There it is:
1430490663-spotify-error.png - envoi d'image avec NoelShack

1430490663-sublime-text.png - envoi d'image avec NoelShack

I got teamviewer if you want too :)

<!-- gh-comment-id:98145192 --> @BillyCallahan commented on GitHub (May 1, 2015): There it is: <a href="http://www.noelshack.com/2015-18-1430490663-spotify-error.png"><img src="http://image.noelshack.com/minis/2015/18/1430490663-spotify-error.png" border="0" alt="1430490663-spotify-error.png - envoi d'image avec NoelShack" title="1430490663-spotify-error.png"/></a> <a href="http://www.noelshack.com/2015-18-1430490663-sublime-text.png"><img src="http://image.noelshack.com/minis/2015/18/1430490663-sublime-text.png" border="0" alt="1430490663-sublime-text.png - envoi d'image avec NoelShack" title="1430490663-sublime-text.png"/></a> I got teamviewer if you want too :)
Author
Owner

@jwilsson commented on GitHub (May 1, 2015):

Great, thanks!

At least we found the problem, cURL needs a local bundle of root certificates. Take a look at this answer: https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/37017 and restart your local server and it should work.

I hope to get a better fix for this into the library.

<!-- gh-comment-id:98146724 --> @jwilsson commented on GitHub (May 1, 2015): Great, thanks! At least we found the problem, cURL needs a local bundle of root certificates. Take a look at this answer: https://laracasts.com/discuss/channels/general-discussion/curl-error-60-ssl-certificate-problem-unable-to-get-local-issuer-certificate/replies/37017 and restart your local server and it should work. I hope to get a better fix for this into the library.
Author
Owner

@BillyCallahan commented on GitHub (May 1, 2015):

Oh my god, it works thank you very much !
You've been so helpful to me 👍
If you need to run some tests on my computer to solve it for everyone, just contact me :)

Audric.

<!-- gh-comment-id:98148722 --> @BillyCallahan commented on GitHub (May 1, 2015): Oh my god, it works thank you very much ! You've been so helpful to me :+1: If you need to run some tests on my computer to solve it for everyone, just contact me :) Audric.
Author
Owner

@jwilsson commented on GitHub (May 1, 2015):

Awesome!

Glad we figured it out :)

<!-- gh-comment-id:98152243 --> @jwilsson commented on GitHub (May 1, 2015): Awesome! Glad we figured it out :)
Author
Owner

@rubenvdb commented on GitHub (Jun 12, 2015):

Seemed to be solved at first, but now stopped working again.

<!-- gh-comment-id:111538207 --> @rubenvdb commented on GitHub (Jun 12, 2015): Seemed to be solved at first, but now stopped working again.
Author
Owner

@jwilsson commented on GitHub (Jun 12, 2015):

@rubenvdb Could you pull down the 0.9.0 branch, test with that code and then open a new issue with the error received.

Thanks!

<!-- gh-comment-id:111584578 --> @jwilsson commented on GitHub (Jun 12, 2015): @rubenvdb Could you pull down the `0.9.0` branch, test with that code and then open a new issue with the error received. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#18
No description provided.