How Microsoft Made PHP Suck Less on Windows


As yet another demonstration of Microsoft's seriousness about participating in the open source community, it's hard at work to make PHP run better (dare we say really well?) on Windows. During last week's Open Source Convention, I spoke with the dude in charge of making that happen.

[ See also: Convincing the Boss to Accept FOSS ]

For years, PHP developers might develop on Windows but never deploy on Windows. And for good reason, explains Garrett Serack, the open source software developer at Microsoft who's involved with the company's Open Source Technology Center. "If you banged on [a PHP application] too hard on Windows, IIS would crash, and nobody could tell why it died," he says. The existing PHP driver was based on old protocols; its performance was "not great" because, Serack says, the PHP community lacked the technical information necessary to improve it.

As you might imagine, that presented a problem for Microsoft, since its own developers knew that a third of Web applications are written in PHP, Serack says. When the company realized that developers weren't using PHP on Windows because really, they couldn't, some inside Microsoft were ready to make a change. Doing so has consumed most of Serack's time ever since. (You can find links to the latest PHP for Windows code at

The first to encourage PHP-on-Windows improvements was the SQL Server team, which wanted to enhance existing open source applications to work better with the SQL Server drivers. (That is, they would like developers deploying PHP apps on Windows to use SQL Server rather than MySQL, or at least to consider doing so without generating gales of derisive laughter.) The first new-and-improved PHP drivers for Windows were released in October 2007. The open source community said — in a nice way, Serack insists — "Your driver sucks." So the SQL Server team went back and redid it, in direct response to what people actually wanted.

Naturally, the team wanted to release the code changes back to the community. Explains Serack, that meant a lot of conversations with Microsoft's legal counsel to get permission to contribute the code. Developing a legal process took months, since releasing code as open source is still a very new idea to the company. But it's not a unique challenge; as Serack points out, "Every large company that has contributed to open source has developed a [legal] process similar to this."

Anyway, at last year's OSCON Microsoft submitted code to ADOdb (a database abstraction layer for PHP) and a couple of others. "About this time last year, the folks in the Open Source Software Lab wanted to accelerate the development of PHP on Windows," Serack says. Pierre Joye (already a PHP committer) had some free time, so Microsoft enabled him to work (with Serack) on the specific goal: improving PHP on Windows.

Meanwhile, Serack got started by improving the Windows PHP build process by scripting it from scratch. As with so many other projects, he had to build tools to build more tools. "I wanted to include all the DLLs," he says. He built a trace tool to track what was being built, and created brand-new Visual Studio project files. "No more

files and custom batch scripts!" Serack sighs happily.

Follow ITworld on Twitter: @IT_world

1 2 Page 1
ITWorld DealPost: The best in tech deals and discounts.