1
votes

I implemented the Facebook API on my website and everything was working fine. Two days ago I moved my website to another server and the Facebook API stopped working. I reset my APP Secret Key thinking that it may fix the problem but it didn't.

The javascript works fine. I can connect using it but when I try to get the user with php it says some error like this: Uncaught OAuthException: Error validating application.

Thanks for your help

2

2 Answers

1
votes

Make sure the new host has the same or newer version of PHP running as the old host. Make sure they have cURL installed and activated. Make sure they have not disabled any remote connection functions such as file_get_contents() or anything that you might be using on the PHP side which would connect to the Facebook API.

1
votes

Fixed! you need to make sure that the values for the appID and secret are strings and not numbers. Silly but I guess that depending on the configuration of PHP sometimes the appID will work as an int and sometimes must be a string. So add quotes to it :)

'appId'  => '216500000000000',
'secret' => '*************************',