Reflecting on PHP-Microsoft Interoperability
This morning I came across this article on PHPDeveloper.org: Blast from the Past – One Year Ago in PHP. That brief look into the past got me to thinking about what Microsoft has done lately toward PHP interoperability. (By “lately”, I mean in the last few years.) And, I’ve been working on a presentation for TechEd in Berlin next month that will, in part, provide a brief overview of Microsoft’s efforts toward PHP interoperability and support. So, I thought I’d share a bit of that summary here…
2006
- Running PHP on Windows/IIS/SQL Server was not really an option. PHP itself was optimized for running on Linux, IIS was using CGI to handle PHP requests (which meant an entire PHP process spun up/torn down for each PHP request!), and access to SQL Server was mainly achieved through the php_mssql extension (which was based on deprecated DBLib technology).
2007
- The IIS team implemented FastCgi to handle PHP requests. In retrospect, this may have been the single biggest step toward improving PHP performance on Windows/IIS. Now, multiple PHP processes could handle PHP requests and the these processes could be recycled without being torn down.
2008
- The SQL Server Driver for PHP 1.0 was released. This driver was built as a thin wrapper of SQL Native Access Client (SNAC), Microsoft’s implementation of ODBC. SNAC is the state-of-the-art Win32 access to SQL Server. Engineers are constantly improving and testing SNAC code, so building a PHP driver on top of it made for a highly efficient, feature-rich driver. And, the source code for the driver was released under an open source license.
- The IIS team also introduced the URL Rewrite Module for IIS, a highly requested feature aimed at enabling SEO-friendly URLs.
2009
- PHP 5.3 was released with several Windows-specific optimizations: PHP was available in a VC9-compiled version, the POSIX layer was removed and the Win32 API was called directly, and every dependent library was built from source code. These changes greatly improved the performance of PHP on Windows.
- The IIS team released the Windows Cache Extension for PHP (WinCache) v1.0. The extension was an opcode, file, and resolved path cache that enabled yet another performance improvement for PHP on Windows/IIS.
- The SQL Server Driver for PHP 1.1 was released. This release included several highly-requested features, including scrollable result sets, built-in UTF-8 support, and SQL Azure support.
- The Web Platform Installer (Web PI) v1.0 was released. In a nutshell, this tool went a long way toward improving the installation and configuration of PHP on Windows.
- The Web Application Gallery was launched. This site made installing any number of PHP applications on Windows as easy as a few clicks.
- The Microsoft Interoperability Team, in conjunction with some folks outside of Microsoft, began releasing SDKs for PHP developers. Highlights for 2009 include the Windows Azure SDK for PHP and the AppFabric SDK for PHP.
2010
- WinCache 1.1 was released. This release included the ability to store application data in shared memory and was function-by-function compatible with APC.
- The Microsoft Drivers for SQL Server for PHP were released. The major leap here was support for PDO.
- Web PI 3.0 was released with more tooling and framework options. More applications were available in the Web Application Gallery.
- The Interoperability Team continued to work with PHP community members to release SDKs for PHP developers (in addition to updating and maintaining previous released SDKs). Highlights for 2010 include the SSRS SDK for PHP, the OData SDK for PHP, Windows Azure Command Line Tools for PHP, Windows Azure Storage for Wordpress, and the Bing Search Library for PHP. The Interop team also worked closely with Soyatec to get Windows Azure tooling support into Eclipse.
- Ruslan Yakushev (PM on the IIS team) released the IIS team released the PHP Manager for IIS 7. This IIS plug-in makes configuring, optimizing, and running multiple versions of PHP on IIS very easy.
And that really just covers the highlights. I haven’t mentioned all of the community-contributed projects on CodePlex.com, the many PHP applications that have added or are adding SQL Server support, or the work that I know is in progress but can’t talk about yet. :-(
Do we still have work to do? Absolutely. Lots of work. But I like the trajectory and the momentum. What do you think? Are we heading in the right direction? Why or why not? I’d love to hear others’ perceptions of the recent history of PHP-Microsoft interoperability and thoughts about future direction.
Thanks.
-Brian
Comments
- Anonymous
October 07, 2010
PHP on Windows has come so far! Thank you to everyone who has helped this effort. WebPI and SQLSrv are fantastic and I've just started playing with the PHP Manager which is looking good so far.I can now sell PHP solutions to my MS-centric clients confident that PHP will work great and my client's IT depts are happy that PHP is going to work well. I've said this before, but this effort has opened up new markets to my company and we've sold PHP to places where Java was the original choice.I'm looking forward to seeing where we go!Regards,Rob... - Anonymous
October 07, 2010
Hi Brian,I started my current job about 3 years ago, just about where your timeline begins - it marked the first time I'd used PHP on Windows and I found it something of a chore! Back then we were quite limited with what we could achieve with Windows because, as you said, support for PHP in the Microsoft stack was lacking.Trying to develop a cross-platform application that performed equally in both *nix and Windows environments was a major challenge that usually required a lot of ifs(), elses() and why????()s, whereas nowadays I've found much less environment-specific code needs to be written. Makes development quicker and a lot less stressful!I agree that the way things are headed is great. I like the PI but find it's not suited to the way I work - I'd like greater control over which version of PHP is installed, with maybe the ability to run a few different versions side by side or at least switch easily between them - I have to use 4 (uurgh), 5.2.x and now 5.3. (I haven't tried the PI in a while, so apologies if this is now possible!).What are the chances of Microsoft becoming involved with PECL and providing some resource for the automated building of DLLs for those extensions? The more common extensions are thankfully supported at Pierre's website but innovation on Windows is hampered because while I can build the less common extensions from source, I can't guarantee others can which makes using them a risk.Have to say that I and the others I work with are most grateful for the recent improvements, and hope that they continue!Cheers,Craig - Anonymous
October 08, 2010
@Rob: That's great to hear! Good to know our efforts are making things better for folks.@Craig: Also great to hear! As far as the Web PI goes, the lack of multiple PHP versions is clearly a shortcoming. I know that the Web PI team is aware of this and hopes to have multi-version support eventually...I just don't know when (although I don't think they have plans to support PHP 4...how important is that for you?).Regarding MS providing a resouce for automated building of PECL extensions...quite honestly, I don't know. However, you are not the first person to request/suggest such a resource. Personally, I think it's a great idea, and the more we hear that folks want this, the more likely it is to happen. I'll keep on it. - Anonymous
October 08, 2010
That's good to hear (multiple PHP versions) - if I were them I wouldn't want to add support for 4 either! Better to encourage people to move to 5. Thankfully I don't have to use 4 much these days, I'd be happy to run it in a VM and have a better PHP5 experience through the PI. PECL support would be fab, please do! - Anonymous
October 12, 2010
The comment has been removed - Anonymous
October 15, 2010
Thanks, Dominic. After reading your comments and your blog post (www.iis-aid.com/.../looking_back_php_iis) I realized I didn't paint (or even know) the complete picture. Thanks for sharing.Cheers,Brian