Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« Faster Page Loading
Why is PHP Code Considered Hard to Maintain? »

PHP as a Deployment Platform

November 4th, 2006

PHP has been incredibly successful as a deployment platform for web applications. The WordPress blog brags that the WordPress 2.0 series has been downloaded 1.2 million times.

However, PHP as a platform is far from homogenous. With many different versions installed and the vast configurability of php.ini, there can be a great deal of variation from PHP installation to PHP installation. PHP developers often ask what should I target? The question is the same if you want to write the next WordPress, or if you want to make sure your code is reusable for the next client that knocks on your door.

Nexen has been publishing PHP version adoption statistics for some time. Damien Seguy has really gone the extra step now by collecting and publishing configuration statistics. These are generated from scanning publicly available phpinfo() output.

The stats range from useful to blog candy.

One thing to keep in mind is sample bias. Damien compared the php version number of the sample against the version data collected from expose php and found they correlate well. But, perhaps there is a bias toward certain configuration settings (or versions) among those who have public phpinfo() data and those who do not. (The stats do have suitable disclaimers.)

Its hard to look at stats like this and decide what they represent. According to the Zend blog, 81% of their customers are using PHP 5, while the nexen monthly numbers report 11%. I think its fair to say that all of Zend’s customers use PHP, while many servers that expose_php are domain parking or serving static pages. What is the adoption rate for php 5? Who knows.

It would be interesting to see the correlation between those installations with expose_php off and the monthly version data, collected from the broader set of servers with expose_php on. I think it would also be interesting to see what functions are being disabled with disable_functions. Which extensions are being loaded? How many servers are running an opcode cache?

Which version of PHP to use? PHP 5 versus PHP 4? Unless you are constrained by legacy PHP 4, the answer is definitely PHP 5. Targeting PHP 4 isn’t going to make you the next WordPress. Its just going to put you as far behind the version adoption curve as they are.

PHP 5 is vastly easier to develop in than PHP 4. Development is expensive. Hosting is cheap. Don’t let the tail wag your dog. If your host doesn’t support 5, change hosts. PHP 5 hosting is not rocket science.

I know the decision is that not simple, but the excuses for remaining with PHP 4 are dwindling.

Which configuration options to target? There was some talk recently on the PHP internals list about creating a recommended .ini profile for development environments and one for production environments. I think this is a great idea. Hopefully, then folks installing PHP can choose a profile instead of setting individual .ini options. Perhaps this would help reign in some variability and reduce some Paradox of choice style unhappiness.

categories Open Source, PHP, Software Design
tags php-deployment

Related Posts

  • Difficult deployments
  • Enterprise PHP
  • Why is PHP Popular?
  • Shipping Software is fun
  • A Glimpse into the Future: PHP 6
You can leave a response, or trackback from your own site.

4 Responses to “PHP as a Deployment Platform”

  1. #1 Ilia Alshanetsky responds...
    November 5th, 2006 at 11:28 am

    Damien publishes monthly stats gathered by examining most IPs in the ipv4 range (with exceptions for virtual hosts) to calculate popularity of different PHP versions. This gives you a fairly accurate representation of what people are actually using as this data comes directly from the X-Powered-By header spit out by PHP on most requests. Based on this data is the 10-11% market for php5 is determined.

  2. #2 Peter Bowyer responds...
    November 6th, 2006 at 1:52 am

    I think I’d go for somewhere closer to the 11% adoption of PHP5 than 81%. I’m still having to write PHP4 because that’s what everyone who contracts me is using. Now anything I write where I can provide the hosting or specify it is PHP5, but it’s still not a big enough % to make me happy!

  3. PHPDeveloper.org trackbacked on November 6th, 2006 at 12:41 pm
  4. #4 Mark de Visser responds...
    November 6th, 2006 at 9:37 pm

    Just playing with these numbers a bit:

    Assume that 4 million developers, releasing 1 new site per year. Of these 80% in PHP 5, 20% in PHP 4.

    Currently out there 20 million websites, 10% of which is now PHP 5, 90% PHP 4.

    In addition to creating 1 new site, the 4 million developers also convert 1 site per year to PHP 5.

    Even in that case it will take another year before Damien will show 10 million PHP 5 websites versus 15 million PHP 4 websites. And that does not account for the fact that all new sites created with tools such as Wordpress will show up as PHP 4 sites (even my own new blog falls in that category).

    So % of developers currently programming in PHP 5 is a very different statistic than % of websites on the internet created in PHP 5.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Add to Google
  • Share This

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (16)
    • Open Source (14)
    • PHP (95)
    • Software Design (28)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • Sarah Snow Stever  26
      Massimo, arabcrunch, Dubai Web Design, Development [...]
    • The PHP scalability saga continues  17
      vaginal, uceqlehwigi, panties [...]
    • Keywords and Language Simplicity  9
      Programmer, cfbow, olmse [...]
    • PHP 5.1 is out  8
      Preteen, Soma, teedattaltY [...]
    • goto in PHP  39
      jistanidiot, Goldilocks, [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  105
      Massimo, jitesh Shetty, Jesse [...]
    • WordPress BBCode Plugin  24
      ?????? ??, ?????? ??, smolenskiy [...]
    • Why is PHP Popular?  24
      art.ru, agened.ru, visasim.ru [...]
    • nofollow and comment spam  7
      Pwhndvve, Massa, che spavento, Scopmazo [...]
    • Why is PHP Code Considered Hard to Maintain?  25
      bez-riska.ru, Visitor338, Cody [...]
    • PHP Scalability and Performance  7
      youporn, kvz, John Loehrer [...]
  • Pages

    • Tags
  • Recent Posts

    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)
    • Keywords and Language Simplicity
    • Improved Error Messages in PHP 5
    • Michigan Taxes Graphic Design Services
    • Ruby versus PHP or There and Back Again
  • Archives

    • 2008: May
    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Log in