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
+26.4k Golang : How to check if a connection to database is still alive ?
+8.6k Golang : HTTP Routing with Goji example
+12k Golang : 2 dimensional array example
+12.6k Golang : Convert int(year) to time.Time type
+7k Golang : File system scanning
+9.2k Golang : How to extract video or image files from html source code
+9.6k Golang : Function wrapper that takes arguments and return result example
+9.2k Golang : Scramble and unscramble text message by randomly replacing words
+12.4k Golang : Remove or trim extra comma from CSV
+34.7k Golang : Upload and download file to/from AWS S3
+5.4k Golang : Shortening import identifier
+8k Prevent Write failed: Broken pipe problem during ssh session with screen command