Lets make a hello world facebook app here.
Firstly download a php sdk from here .This allows you to use loads of functions which you needn’t worry about defining !!
Paste this in your server (directory) /var/www in LAMP or htdocs in xampp
Now you need to register as a developer and also provide details of your app in facebook , so login to your facebook account and register as developer (look here)
Once you are registered as a developer , go here
Click on create new app, and provide the name of your app, (it has to be unique!)
After the security check , it allows you to edit the app settings.
Here inside your /var/www or htdocs you need to create a directory_name folder and paste your codes (.php , .html etc) inside it.
I use something like http://localhost/face/app_name/
‘app_name’ is a folder inside ‘face’ , this allows you to have multiple app_name inside face.
Now copy this and save as appname.php inside your directory specified in the Canvas url of facebook app.
The php codes needs you to mention appid ,secret and path to facebook.php (from downloaded sdk)
Run the app in a browser , http://localhost/face/app_name/appname.php.
If it is running you should be able to see your profile pic and other information.
While developing apps you may need to get permissions on certain user data , for that go to permissions in app settings page.
Enter details in User & Friend Permissions: or Extended Permissions:
To test these go here
In case you need to install server or create localhost go through this
After these steps if still , the app doesn’t run , check link