One of the most common questions I get regarding Facebook’s new PHP SDK v4.0.x is how to set it up and get started. My previous tutorial covers how to start using the SDK, but not how to arrange your files and the SDK itself – this tutorial attempts to bridge the gap.
After downloading the latest version of the Facebook PHP SDK (currently v4.0.7), you need to extract the source code and copy them into your application folder. The best way to do this is to copy the contents of the src
folder into your application folder. The src
folder contains a single Facebook
folder with all the PHP files you need to use the SDK. You only need to copy the Facebook
folder from here.
A typical application setup can be as follows:
If you use a PHP Framework like CodeIgnitor, you should copy the Facebook folder to the /application/libraries
folder instead. For example:
Once the basic file structure is set up, you can follow the “Getting Started” tutorial to find out how to start building Facebook Apps.
[…] significant changes to how some of the API calls work while deprecating other features. The current Facebook PHP SDK stable version is still v4.0.9 and uses Graph API v2.0, but PHP SDK v4.1 will eventually make use of Graph API v2.1. Facebook has […]
This was a huge help — thanks!
THANK YOU!! these set of postings were incredibly helpful. After some reading, I was able to learn, and implement what I needed. MMMUCH appreciate your postings and help!!