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
+13.8k Golang : Activate web camera and broadcast out base64 encoded images
+15.3k Golang : Save(pipe) HTTP response into a file
+12.9k Golang : Listen and Serve on sub domain example
+10.7k Fix ERROR 1045 (28000): Access denied for user 'root'@'ip-address' (using password: YES)
+6.2k Java : Human readable password generator
+14.7k Android Studio : Use image as AlertDialog title with custom layout example
+12.4k Golang : List running EC2 instances and descriptions
+7.6k Golang : Detect sample rate, channels or latency with PortAudio
+9.2k Golang : Capture text return from exec function example
+14.5k Golang : Parsing or breaking down URL
+17.8k Golang : Read data from config file and assign to variables
+31k Golang : Download file example