Monday 30 November 2009

PHP on Windows

According to Microsoft 70% of PHP developers are working on Windows, although the majority of PHP services are hosted on Linux (in my case this was actually true so maybe they are right about that). This leads to situation where most of the apps are being developed in an environment different than they are deployed to. This is obviously not the best way to that.

Microsoft claims there are 2 main reasons for that:

  1. Installation process

  2. Although there are many packages available for one-click installation of all necessary PHP components on Windows (e.g. WAMP) they are all configured to work with Apache server. Although IIS is recommended server to be used for PHP on Windows (to get most of what the system offers), developers are afraid of configuring/using it with their apps.

    Microsoft decided to change it by introducing Web Platform Installer. This free tool will download, install and configure all components required to run web applications on your machine for you (both Asp.net and PHP). It also offers installation of popular OpenSource scripts/engines (e.g. for blogs, galleries, etc.) so you can start development faster.

    This seems to be a step in a good direction and makes configuration of PHP and IIS easy like never before. However, there are still some some weak points in my opinion:

    • Developer is limited to one version of PHP (what if you need to install older version?)

    • The installer supports mainly Microsoft technologies e.g. drivers/extensions for MsSql. I haven't seen any option for installation of MySql extensions.

    • Some very popular php apps are missing e.g. phpBB (probably MS promotes an equivalent supported by them)


  3. Performance

  4. This one is actually more important than installation. Microsoft admits that PHP did not performed well on older versions of IIS. However, together with introduction of IIS7 most of the performance issues should have been resolved. The key aspects for improving performance are:

    • Microsoft contributed to creation process of PHP build for Windows e.g. rewritten parts of the code to make better use of the system

    • Implementation of FastCGI for Windows (can by installed with Web Platform Installer)

    • Windows Cache Extensions for accelerating PHP

    • Ability to work in a cloud (thanks to Windows Azure)


    I asked the speaker about any reliable benchmarks comparing performance of PHP in Windows vs. Linux environment that would prove that it is worth considering deployment of my PHP apps to Windows. Unfortunately this strongly depends on the app itself so there is no simple answer to that question.

Soo, who's convinced?

BTW. When I asked the Microsoft guy about examples of large, commercial PHP applications deployed on Windows and performing well he answered that there are some but he's not allowed to name them ;)

1 comment:

Jaroslaw Dobrzanski said...

Maybe that mysterious platform was MSDN :P