1

I am a newbie who is trying to create a Facebook app using PHP and Facebook's PHP SDK. The app is hosted on Heroku, and the sample app that they provided is working fine. However, I am now trying to get the sample app to work on Apache 2.2, and I have encountered a lot of problems along the way. Well, straight to the point, my latest problem will be trying to do Facebook login on localhost, but the 'An error occurred. Please try later' appears on the popup dialog. This does not happen on Heroku.

Will someone please enlighten me on if there's any steps that I can take to overcome this error? I don't think it got to do with any coding error since I am just following the provided sample app. Thanks!

  • Please have a look, http://stackoverflow.com/questions/5133075/running-facebook-application-on-localhost – GoSmash Apr 12 '12 at 05:24

2 Answers2

0

This is happening because FB does not recognize the URL of the host issuing requests. You need to determine what the FQDN of your localhost server is then add it to the Site URL section of the FB App Settings manager. Chances are you have the URL of your Heroku server in there now.

Mike Purcell
  • 19,847
  • 10
  • 52
  • 89
  • does that mean I should create a new app on FB that is not hosted on Heroku? – Eugene Zhuang Apr 12 '12 at 05:38
  • That's what we had to do at work. One account for development, one account for production. – Mike Purcell Apr 12 '12 at 05:38
  • I use http://localhost to test my app. Does that count as the FQDN for me to put on the Canvas URL and Secure Canvas URL sections? Thanks. – Eugene Zhuang Apr 12 '12 at 05:51
  • Good to hear. According to the link that Ramesh posted, it appears it is possible to test FB functionality from localhost without having to update the URL section. I cannot confirm nor deny but it definitely is another option. – Mike Purcell Apr 12 '12 at 05:55
  • I first thought i cant be used in localhost and i made a search and found a method to work from localhost. Thank you guys. Good job. – GoSmash Apr 12 '12 at 05:59
0

its simple. in local host you must create another sample application for localhost in facebook .and you must have the permission.then you can login and work with your local one.

simply for every copies of your app.you must create it in facebook

hope it help you

good luck

Arun
  • 87
  • 13