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
+12.1k Golang : Date and Time formatting
+21.1k Golang : How to read JPG(JPEG), GIF and PNG files ?
+4.6k How to check with curl if my website or the asset is gzipped ?
+7.3k Golang : Ackermann function example
+7.2k Golang : Metaprogramming example of wrapping a function
+13.1k Golang : Recombine chunked files example
+15.3k Golang : Get the IPv4 and IPv6 addresses for a specific network interface
+23.7k Golang : Get current file path of a file or executable
+13.4k Golang : Get URI segments by number and assign as variable example
+21.1k Golang : Read a file into an array or slice example
+30.1k Golang : Math pow(the power of x^y) example