Please wait while the page is being loaded Skip this advertisement >
Saturday | 6 December, 2008
Facebook launches library to ease PHP embedding blues
Engineer Andrew 'Boz' Bosworth says PHP programming language is the language of choice for Web developers
Dahna McConnachie 09/10/2007 08:31:45

Facebook engineers have made it easier for developers to embed PHP by developing a PHPEmbed library..

"The library is just a more accessible and simplified application programming interface (API) built on top of the PHP Server API (SAPI). The library is so useful, we decided to share it with the world," writes Facebook Engineer Andrew 'Boz' Bosworth.

Bosworth said that the PHP programming language has solidified itself as the language of choice for many top Internet properties, including Facebook, as it is easy to use and integrates well with Apache, Memcache, and MySQL.

"Despite its suitability for web development and scripting, PHP is generally not the best choice for standalone software or servers. C++, on the other hand, is well suited for building both online and offline services," he writes.

"Unfortunately, if the new services operate with data managed by the existing PHP code base it can be dangerous to use a separate data access pattern. If the cache keys or database schema were to change in the PHP code base then the service would be broken (and potentially corrupting data for the PHP code base) until the code was updated and the program recompiled and restarted."

It was in response to this problem that Bosworth and his colleagues decided to embed the PHP Interpreter into C++ binaries.

"This isn't a novel endeavor by any means; Apache uses the PHP Server API (SAPI) to accomplish exactly that. However, when we began attempting integration of our own we found that the SAPI required quite a bit of expertise to manipulate effectively," Bosworth says.

Computerworld Buyer's Guide - Vendors Matched to this Article
More about MySQL, Apache, HIS Limited
Computerworld Buyer's Guide - Vendors Matched to this Article
Additional Resources
Executive Guides
Whitepapers
Zones
Zone logoZones provide focussed content from Computerworld and leading technology partners.
Newsletter Subscription
Sign up for our Computerworld newsletters!
RSS Feeds
Market Place

 

Smart SOA World Tour

Discover how SOA can create smarter outcomes for your business.

Attend and learn:

  • How SOA is helping leading companies to become more agile
  • Where you should be applying SOA processes in your company
  • The top SOA implementation mistakes to avoid

Click here for more information.
Whitepaper

Everything you need to know about email and web security (but were afraid to ask)

What you don’t know can destroy your business. It’s hard to imagine modern business without the internet but in the last few years it has become fraught with danger. Read on to discover how internet security can give your business a competitive advantage.

Enterprise IT Buyer's Guide
Find Technology Vendors Fast
 
Find vendors by name | Find by category
Sponsored Links