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
+8.1k Setting $GOPATH environment variable for Unix/Linux and Windows
+10.7k Golang : Create matrix with Gonum Matrix package example
+9.5k Golang : Web(Javascript) to server-side websocket example
+7k Golang : Pat multiplexer routing example
+24.6k Golang : Change file read or write permission example
+4.8k Linux/MacOSX : How to symlink a file?
+10.3k Golang : How to profile or log time spend on execution?
+13.3k Golang : Convert(cast) int to int64
+46.6k Golang : Encode image to base64 example
+12.9k Golang : Add ASCII art to command line application launching process
+43.5k Golang : Convert []byte to image
+10.7k Golang : Flip coin example