Microsoft

PHP on IIS -> fast and supported

Jesse and I went to the Microsoft Web Developer Summit a few weeks ago representing Gallery. Microsoft promised us that they were trying to be better citizens in the PHP community and make PHP work better on Windows. For those of you not in the know, the common way to run PHP on IIS was through CGI, which means that every single visit to a PHP page requires loading the entire PHP stack. Think starting up your web browser from scratch every time you open a new URL, and multiply that slowness by a few thousand users... it's baaaad. To get around this for PHP (and other CGI scripts) FastCGI came along and made everyones servers perform better. It daemonizes PHP (or anything else supported) so that it doesn't need to start up for every request, but it's never worked quiiiite right on IIS and has never been supported. Until now.

So today, after working with Zend for a while, Microsoft has released FastCGI today for the current version of IIS, with full Microsoft Support. Have a PHP app that you are trying to get to work in IIS? They'll help you. Cool! You can download FastCGI for free from www.iis.net/php. (And from what I understand, it really is FastCGI so you can use it for any CGI based application server in IIS.)

Have a Windows server running IIS? Want to use Gallery? Check out the howto that Microsoft wrote on Installing Gallery 2 on IIS. In addition to writing some docs, over the next few months Microsoft will supposedly be getting us resources like virtual machines, licenses, hosted test environments, etc so that we can make Gallery work on a wider range of Microsoft products.

A little Kool-Aid is definitely good every now and then.

Microsoft Web Developer Summit 07

Sunday to Tuesday of this week, Jesse and I represented Gallery at Microsoft's invite only 3rd annual Web Developer Summit. This year their focus was on PHP, and 24 "important" people from the PHP community were invited. The two authors of the book "Pro Drupal Development" that are also Drupal core developers, several people form the PHP (and PEAR) core team, an engineer from SugarCRM, and the guy at Facebook that wrote their developer platform were among the other attendees. On the Microsoft side were the important "higher ups" that work with Open Source technologies (see microsoft.com/opensource).

Sunday was my flight out and a few hours of catching up with an old friend I haven't seen since middle school, followed by meeting up with Jesse for some beer samplers at a local brewery, followed by some snacks and drinks with the rest of the summit attendees.

Monday was a day full of sessions followed by dinner, and Tuesday was more sessions. You can read someone else's presentation notes here so I'll keep this to highlights:

  • Pictures! Jesse's blog where he talks a lot more about some details
  • Microsoft is seriously interested in Open Source now. They've realized that their value is as a platform, and PHP applications need to work well on Windows for people to be willing to use Windows in may server environments. Sure, it's just business because thats what their customers demand, but they're ready to work with us to do what needs to be done.
  • Monday after dinner (and after Jesse ordered a round of tequila shots for the entire conference on Microsoft's tab), I spoke with Sam Ramji, Microsoft's Director of Platform Strategy, for an hour or so. He runs the Open Source Software Lab at Microsoft and was very interested in any ideas that I and the other attendees have for Microsoft.
  • Surprisingly, many of the ideas we had were news to them. It seems that there are a lot of things in the community that we all think Microsoft should do, but nobody ever goes to the trouble of telling them! Things like experienced Linux admins wish their BASH and Apache configuration skills could transfer more directly to PowerShell and IIS, etc. I don't remember all of these because they seemed so obvious, but they took notes and hopefully will get around to doing some of these.
  • Jesse and I were convinced at the last minute to do a talk on Gallery. We quickly put together a presentation and some people at least seemed pretty interested. We got a healthy number of questions and I looked at some number I haven't looked at in a while (Gallery gets ~150k downloads a month!). As a result of this, we may have 2 people contributing some code and one person starting on some more documentation for us. Hoorah.
  • While some of the presentations were pretty useful, much of it wasn't really targeted to the audience. Sure, learning about Silverlight and Expression were neat, but were they really the best use of our time? Probably not. However, internet worked well and it was easy to get other things done during the less interesting parts. (And most people in the room were on IRC so we could discuss things at the event as they happened.)
  • We were not given suitcases full of cash to use ASP.net, but each of us walked out with a full MSDN Subscription and Microsoft is going to be working with us to provide whatever products and licenses we need to be able to effectively develop for and test on Microsoft platforms including IIS7, Windows Server 2003 and 2008, Microsoft SQL Server, etc. No complaints there. (One attendee just hasn't gotten around to publishing something she's been working on yet, and it sounded like Microsoft will be shipping her an XBox 360 to encourage her to get around to it :) )

All in all, it was a pretty useful couple of days. I think the most important part was networking with other PHP developers and the Open Source people at Microsoft, as this should encourage future email conversations with everyone to be timelier and more effective. Hopefully, everything will come through and Microsoft will be able to provide Gallery with what we need to be able to test and develop on Windows, and hopefully Microsoft will be able to implement some of our suggestions for the way they work with Open Source. They do seem very interested in making this happen! If you want to read more from them (which you should, especially if you think I've just been drinking their KoolAid all week), check out: port25.technet.com and microsoft.com/opensource.

Agree To Disagree?

I never thought I'd see this from this particular crowd of companies but here's the basic timeframe for those of you that don't follow this. For years, Microsoft has claimed that Open Source Software couldn't provide a workable business model. In August 2003, Novell (another large software company) began embracing Linux as a solution for it's customers. In November 2006, Novell entered into a patent agreement with Microsoft which led to people complaining that Novell had "sold out." Microsoft says that Linux infringes on their patents, Novell said that they didn't agree but still had a partnership with Microsoft working towards the same goals.

And the kicker: Microsoft responded with a press release saying that they and Novell were _Agreeing to Disagree_ on an issue that many see as the core component of the initial agreement! It'll be interesting to see how this pans out.

Me and Microsoft's KB912812 Cumulative Security Update

So there I was minding my own business when Microsoft decides to make my life that much more complicated. They do their security updates all the time and given that I manage websites but don't have a windows box, I try and read the details of each release to be aware of any issues it may cause. This one in particular (KB912812)had me concerned because it changes the way that embedded objects are handled. On reading the details, it looked like my Javascript code that uses an ActiveX control to send asynchronous HTTP requests in IE would be fine because the code isn't activated when the page loads, only responding to user input. Cool.

The update came out, some people started getting it on their machines, and I started getting complaints about the dropdown menus on collegemedium.com not working. I sent them to ckdake.com which uses the exact same csshover.htc hack to let IE use :hover on any element of a page allowing for dropdown lists to be nested HTML unordered lists with CSS to display all of it. The ones on ckdake.com worked just fine for all of them which made no sense. If one broke, shouldn't the other?

After hours and hours of debugging I finally figured out the root cause. Microsoft forgot to document a fairly major change in some unconfigurable Javascript security settings. Most things you can change by setting a custom security level in IE preferences, but if there is anything similar to the about:config that Mozilla based browsers have, I've never seen it. Previously, I had to change a few things to get the Javascript to play nice in IE. For IE to allow an AJAX request to go out, the page, Javascript file, and AJAX target have to be on the exact same domain. I had to move the Javascript files from static.collegemedium.com to the includes folder on every other subdomain (marketplace, jobs, etc) to get any of that to work. This is to prevent phishing attacks and some cross site scripting attacks which makes sense I guess, but properly designed web sites should prevent the attacks and the limitation seems a bit artifical and unnessecary to me. Whatever. It turns out the new update now requires any CSS file that Javascript interacts with to be on the same subdomain, not just for writing to it dynamically in the DOM, but even for just reading from it! Thats crazy and completely undocumented. Putting the CSS file on all the subdomains and setting all the image paths in it to point to static.collegemedium.com instead of being relative URLs fixed the problem completely.

This all may not seem like that big of a deal, but because of the somewhat silly restrictions that IE places on Javascript, I now have to have an extra 20 kilobytes of files on each subdomain. Instead of these files getting cached on each machine, If a user hits each subdomain they will have to load 140 kilobytes instead of 20, slowing their user experience and upping the bandwidth usage on the server. If your nifty Javascript DOM CSS stuff stops working after KB912812, I hope you stumble across this and don't waste a day trying to fix your problem.