Skip to main content

OSCON 2006: Gettting Rich with PHP5

By Kevin Yank

Programming

Share:

Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR.

PHP’s creator, Rasmus Lerdorf, gave a surprising talk on building PHP rich web applications using PHP5—suprising, because fully half the talk focused on low-level PHP optimization techniques. The slides are available online.

Taking a simple PHP script as an example, he set out to optimize it to meet a request throughput requirement of 1700 requests/second (as measured by http_load). Techniques he touched on along the way included using KCachegrind to analyze the Apache process running your script, in order to determine what parts of PHP are actually causing the slow-down in your script.

Some examples of bottlenecks he identified and fixed included a default PostgreSQL setting that uses secure SSL connections (with significant overhead) and PostgreSQL database connections, which are much slower than connecting to MySQL. He also showed how to further improve performance by caching PHP intermediate code and automatically optimizing that code using the various features of Alternative PHP Cache, a project that Lerdorf is actively working on right now.

Lerdorf then spent some time looking at new features of PHP 5.0 and 5.1 that make building Web 2.0 applications easier, including the libxml-based XML handling functions, SimpleXML, and the object oriented SOAP library, but these are things with which most serious PHP developers will already be familiar.

A few of his demos showed off PHP parsing various feeds and producing interesting user interfaces using the YUI Library, and he capped off the talk with a few Google Maps and Yahoo! Maps mashups powered by simple PHP scripts. Interesting in these demos were those that directly called the Yahoo! Maps API to pull map tiles for particular locations directly on the server-side (rather than loading up a full DHTML user interface on the client side).

Kevin Yank is an accomplished web developer, speaker, trainer and author of Build Your Own Database Driven Website Using PHP & MySQL and Co-Author of Simply JavaScript and Everything You Know About CSS is Wrong! Kevin loves to share his wealth of knowledge and it didn't stop at books, he's also the course instructor to 3 online courses in web development. Currently Kevin is the Director of Front End Engineering at Culture Amp.

New books out now!

Get practical advice to start your career in programming!


Master complex transitions, transformations and animations in CSS!