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
+8k Golang : Metaprogramming example of wrapping a function
+7.9k Golang : Variadic function arguments sanity check example
+12.4k Golang : Get absolute path to binary for os.Exec function with exec.LookPath
+19.7k Golang : Convert(cast) bytes.Buffer or bytes.NewBuffer type to io.Reader
+10.4k Golang : Flip coin example
+15.8k Golang : Get sub string example
+7.6k Golang : Lock executable to a specific machine with unique hash of the machine
+11k Golang : Calculate Relative Strength Index(RSI) example
+14.3k Golang : How to get URL port?
+5.2k Golang : Get S3 or CloudFront object or file information
+6.6k Golang : Muxing with Martini example
+30k Golang : How to verify uploaded file is image or allowed file types