Windows Server and Fast CGI Technologies For PHP


Published on

PHP is a wildly popular scripting language for the web, and powers some of the largest websites on the Internet. Traditionally, PHP on Windows has been something of an oxymoron.

Join us and find out why PHP is now highly performant, scalable and efficient when run under FastCGI on Windows Server and IIS. Presented by a local PHP developer, you'll gain insight into how you can take advantage of PHP on Windows, and integrate it with technologies like PowerShell, ASP.NET and SQLServer.

Originally presented at Microsoft TechEd Africa 2009 (August 3, 2009)

Published in: Technology
1 Comment
1 Like
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Met a couple of speakers in the lift last night… said I was doing the PHP talk… yeah…
  • Q: Why are you here?
  • For the longest time, Microsoft ignored OpenSource
  • But that’s changed
  • PHP Community develop on Windows (Zend Studio, etc) but DEPLOY to LinuxWindows = Performance vs. Reliability issueWindows: Heavy to start a process, light to start a threadLinux: Light to start a process, heavy to start a process
  • Multiple versionsWordpressURLRewriting
  • Multiple versionsWordpressURLRewriting
  • Windows Server and Fast CGI Technologies For PHP

    1. Windows Server & FastCGI technologies for PHP<br />Tim Keller<br />Lead Developer<br />Umoya Networks ·<br />DTL318<br />
    3. PHP at a Microsoft eventWhat on earth?<br />A Microsoft Primer for PHP developers<br />A PHPPrimer for Microsoftdevelopers(more likely, since this is TechEd)<br />Either way, welcome! Thanks for coming.<br />
    4. Who am ITim Keller (@timkelleror<br />Your typical Mac/Linux type<br />Lead Developer of a PHP-based cloud hosted tool for teachers and school admins, called staffroom<br />Microsoft-friendly<br />HI, I’M TIM KELLER<br />LEAD PHP DEVELOPER<br /><br /><br />
    5. GoalsGood intensions<br />Show you some cool stuff<br />Tell you where you can get it<br />Tell you where you can learn more<br />Answer questions<br />Go have a beer with all of you<br />
    6. Stuff we’ll talk about6 things. Simple.<br />Microsoft and Opensource<br />PHP and IIS<br />Powershell for IIS<br />SQL Server Driver for PHP<br />Microsoft Ajax Library<br />Silverlight and PHP<br />
    7. TAG TWEETS WITH<br />#techedsa2009<br />FOLLOW ME<br /><br />
    8. Microsoft and OpenSource<br />
    9. DeniaL<br />It’s not just a river in Egypt.<br />
    10. Microsoft and OpenSourceSurprising perhaps<br />MS Redmond OSS lab<br />Staffed by OSS and Linux experts<br />300 servers of varying types<br />340+ Linux distros available for testing<br />Tests interoperability of OSS and Windows<br />Research of OSS technologies<br />
    11. Microsoft and OpenSourceSurprising perhaps<br />Projects so far…<br />Firefox Silverlight support<br />Silverlight/Moonlight common standard<br />Vista Firefox compatibility<br />FastCGI hosting of PHP and Python on IIS<br />SQL Server drivers for PHP and Java<br />
    12. Microsoft and OpenSourceSurprising perhaps<br />Active and Future projects<br />PHP Active Directory integration<br />PHP SharePoint integration<br />SugarCRM SQL Server connectivity<br />Windows - Apache build support/research<br />
    13. Why PHP anyway?<br />
    14. BraverY<br />Wounds Heal. Chicks dig scars. Glory lasts forever.<br />
    15. PHP Web Applications<br />
    16. PHP Web Frameworks<br />
    17. Commercial sites using PHP<br />
    18. HARD TO IGNORE.<br />
    19. PHP on Windows, with IIS<br />
    20. PHP on WindowsIt’s actually been around for a long time<br />Most PHP developers:<br />Develop on Windows<br />Deploy to Linux, BSD, *nix.<br />Perception that PHP on IIS sucks (this was true)<br />Often install Apache for Dev or Production<br />
    21. Performance vs. Reliability<br />
    22. FastCGI: Pooling and Caching<br />HTTP Request<br />index.php<br />PHP<br />PHP<br />HTTP Request<br />login.php<br />PHP<br />PHP<br />FastCGI process pool for PHP5<br />PHP processes are reused.<br />No process creation overhead = 20x performance increase<br />HTTP Request<br />header.php<br />
    23. IIS7+ FastCGI HandlerBasic Architecture<br />FastCGI process pool for PHP5<br />IIS Worker Process<br />FastCGI protocol over named pipes or TCP<br />php-cgi.exe<br />FastCGI process pool for PHP4<br />Request queue<br />php.exe<br />
    24. CommunitY<br />You’d be surprised what you can accomplish when you work with people who have common goals and ideals.<br />
    25. 2006Zend and Microsoft announce collaboration<br />2007Zend and PHP Core Devs start optimising PHP5.2.x builds for windows. FastCGI extensions for IIS6.<br />2008MS release IIS7 with native FastCGI for PHP.<br />
    26. 2008Microsoft’s Pierre Joye and the PHP community conduct major work on the PHP 5.3 codebase.<br />Fixed 60+ Windows-specific bugs<br />Updated every library to latest version (some were 10+ years old)<br />Compiled PHP with VC++ 9 (VS 2008)<br />x86 and x64 builds for Windows<br />
    27. 2009<br />Microsoft release IIS 7.5 builds with Windows 7 and Server 2008 R2 builds.<br />Zend ships Zend Core for Windows with Microsoft’s FastCGI implementation<br />
    28. Popular Web Servers (June ‘09)<br />IIS7<br />IIS6<br />IIS5<br />Courtesy:Netcraft Web Server Survey, June 2009.<br />
    29. Where to get all thisPHP and FastCGI goodness<br />IIS 6 (Windows Server 2003)<br /><br />IIS 7 (Windows Vista SP1 and Server 2008)<br />Ships with the product.<br />Activate the CGI feature through Server Manager<br />IIS 7.5 (Windows 7 and Server 2008R2)<br />Supports Failed Request Tracing for FastCGI (PHP)<br />
    30. Setting up PHP on Windows & IIS<br />Tim Keller<br />Lead Developer<br />Umoya Networks<br />demo<br />
    31. Mission impossiblE<br />Wait…what?<br />
    32. PHP Developers want:<br />Multiple versions of PHP on one server.<br />
    33. Real-world PHP<br />Tim Keller<br />Lead Developer<br />Umoya Networks<br />demo<br />
    34. URL Rewriting<br />Ever used mod_rewrite in Apache?<br /><br />IIS7 offers this, without the need for complex Regular Expressions<br />
    35. URL Rewrite<br />Tim Keller<br />Lead Developer<br />Umoya Networks<br />demo<br />
    36. PowerShell and IIS<br />Powerful command line for Windows<br />With IIS7.5 you can manipulate your IIS config using PowerShell<br />Create websites<br />Manage Security<br />Configure FastCGI<br />Much more<br />
    37. SQL Server and PHPAn INNER JOIN made in heaven?<br />Simple Goal<br />To provide robust, scalable, and reliable SQL Server connectivity to PHP developers targeting the Windows platform.<br />Built by Microsoft with community feedback<br />Version 1.0 released July 2008<br /><br />Microsoft working with SugarCRM (PHP app)<br />
    38. ASP.NET AJAX and PHP<br />Take back the web, sorta.<br />
    39. What is AJAX?<br />Traditional Client/Server<br />AJAX Paradigm<br />User Interface<br />User Interface<br />Ajax Engine<br />Request<br />Response<br />Web Server<br />Web Server<br />
    40. What AJAX (sometimes) means<br />DHTML: HTML + Javascript<br />Animations<br />Drag and Drop<br />Show and Hide<br />Partial page updates<br />User interface makes background calls to server<br />AJA* : XML, HTML, Text, JSON…<br />
    41. ASP.NET AJAX<br />A library in three parts<br />MS Ajax LibraryJavascript files for the frontend<br />ASP.Net Ajax ExtensionsServer-side .NET code<br />ASP.Net Ajax Control Toolkit Shared-source components <br />The PHP MS AJAX library was released in 2008.<br />
    42. ASP.NET AJAX with PHP<br />Tim Keller<br />Lead Developer<br />Umoya Networks<br />demo<br />
    43. Silverlight from PHP<br />
    44. Hi, haaaave you met XAML?<br />XML-based description of a Rich User Interface.<br />Part of the Windows Presentation Foundation.<br />PHP can easily output text/xml.<br />XAML also supports UI Events. Which is cool.<br />&lt;Canvas xmlns=&quot;;&gt; &lt;TextBlock&gt;Hello World!&lt;/TextBlock&gt; <br />&lt;/Canvas&gt; <br />
    45. Silverlight from PHP<br />Tim Keller<br />Lead Developer<br />Umoya Networks<br />demo<br />
    46. Interoperability<br />It’s about building relationships for the common good.<br />
    47. Call to actionWe want you!<br />EnableFastCGI in IIS7<br />Install PHP<br />Grab some cool PHP apps<br />Tell your friends how great PHP is on IIS.<br />Tweet about it!<br />
    48. Session Resources<br />Web Platform Installer<br />URL Rewrite in IIS7<br /><br />PHP on Windows central<br /><br />PHP builds and sourcecode for Windows<br /><br />Microsoft AJAX for PHP<br /><br />Silverlight<br /> and<br />
    49. question & answer<br />
    50. Required Slide<br />Speakers, <br />TechEd 2009 is not producing <br />a DVD. Please announce that <br />attendees can access session <br />recordings from Tech-Ed website. These will only be available after the event.<br />Tech·Ed Africa 2009 sessions will be made available for download the week after the event from:<br /><br />International Content & Community<br /><br />Microsoft Certification & Training Resources<br /><br />Resources for IT Professionals<br /><br />Resources for Developers<br />Resources<br />
    51. Related Content<br />Required Slide<br />Speakers, <br />please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner.<br />Breakout Sessions <br />WUX301 – Microsoft Codename Velocity (Mon, 15:45, C3)<br />DTL302 – Embrace OpenSource on CodePlex(Tues, 12:00, A3)<br />WSV309 – What’s new in Server Core for Windows Server 2008 (Tues, 14:30, D5)<br />WUX302 – ASP.NET Under the covers (Tues, 17:30, C3)<br />Whiteboard Sessions<br />WTB216 – Web Development Whiteboard Discussion (Tuesday, 13:15-14:15, Room C1)<br />
    52. Required Slide<br />10 pairs of MP3 sunglasses to be won<br />Complete a session evaluation and enter to win!<br />
    53. Required Slide<br />© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />