Skip to content

Facebook’s Official PHP Client Library Moves to New Location, now PHP SDK

May 3, 2010

Joyent, a Web hosting company, is offering free Facebook app hosting for one year.  So far my experience with it has been pleasant, but I’m not sure how I’d be faring without plenty of prior experience building Web apps.

Joyent supports Ruby on Rails, PHP, and Python for Facebook development.  I decided to follow the path of least resistance and go with PHP, since they support it “Out of the Box”.  I got a “Hello World” app running out the gate quickly, but when I tried to install the Facebook Client library, I ran into trouble.

The developer wiki on Joyent’s site wants you to go to a Subversion repository on Facebook, but the link is dead so their instructions fail.  Facebook’s dev Wiki, on the other hand, links to GitHub.

To make it work, I logged into my Joyent account via SSH and ran these commands:

cd ~/web
mkdir php
cd php
curl http://download.github.com/facebook-php-sdk-v2.0.2-0-gdffbcde.tar.gz 2>/dev/null |\
gtar -xzf - --strip-components=2 'facebook-php-sdk-94fcb13/src/facebook.php'

(I got the URL for the gzip file by navigating to http://github.com/facebook/php-sdk/downloads, clicking the most recent tgz link, and noting the download location in the Firefox download dialog.  I’m sure there are easier ways to do this.)

Then you’ll get a php directory with the facebook.php file, and you can include it in a script in your public directory like this:

require '../php/facebook.php'; ?>

Note:  I just took a peek at Facebook’s wiki history and I can see that they updated this on April 29th (3 days ago).  Also, it looks like the name has changed from “Facebook Client library” to “Facebook PHP SDK”.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: