How to test Facebook App on localhost ?
Usually, in the past when I setup Facebook application for my websites. The new Facebook App Connect API has no problem allowing me to run tests with a live server. However, this time I need to run couple of tests for a new PHP project using Facebook Connect APIs on localhost server. To get this done, see the following steps.
Let say the app is located at
http:://localhost/fbapp
To make the Connect button returns back to the
http://localhost/fbapp
Under the target app settings. Change Site URL to
http://localhost/fbapp
On the machine that you are running the test. Edit the
/etc/hosts
file or if you are using Windows, editC:\WINDOWS\system32\drivers\etc\hosts
Add the line
127.0.0.1 localfbapp.com
This should trick Facebook Connect API to allow the tests to be run locally.
Hope this tutorial can be helpful.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+5.3k Golang : Join lines with certain suffix symbol example
+5.9k Golang : Pat multiplexer routing example
+5.6k Golang : Calculate diameter, circumference, area, sphere surface and volume
+17.2k Golang : Logging with logrus
+10.1k Use systeminfo to find out installed Windows Hotfix(s) or updates
+3.9k Unix/Linux : How to pipe/save output of a command to file?
+27.3k Golang : Detect (OS) Operating System
+39k Golang : How do I convert int to uint8?
+4.3k Golang : Pad file extension automagically
+12.6k Golang : unknown escape sequence error
+12.2k Golang : Generate Code128 barcode
+27.6k Golang : Saving(serializing) and reading file with GOB