Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Microsoft, PHP and IIS7


Published on

Presented to the Sydney PHP User Group, 4th September 2008

Published in: Technology

Microsoft, PHP and IIS7

  1. 1. Nick Hodge Microsoft Australia Professional Geek [email_address] Jorke Odolphi Microsoft Australia Web Infrastructure Evangelist [email_address]
  2. 2. This is not your father’s Microsoft
  3. 4. IIS Request Processing Server functionality is split into ~ 40 modules... Modules plug into a generic request pipeline… Modules extend server functionality through a public module API. Authorization ResolveCache UpdateCache … … … Monolithic implementation Install all or nothing … Extend server functionality only through ISAPI … Send Response Log Compress NTLM Basic Determine Handler CGI Static File ISAPI Authentication Anon SendResponse Authentication ExecuteHandler ASP.NET PHP
  4. 5. IIS 6.0 ASP.NET Processing Runtime limitations Only sees ASP.NET requests Feature duplication … … … … aspnet_isapi.dll Send Response Log Compress NTLM Basic Determine Handler CGI Static File ISAPI Authentication Anon Authentication Forms Windows Map Handler ASPX Trace …
  5. 6. IIS6 Application Framework support <ul><li>Common Gateway Interface (CGI) for CGI and PHP applications </li></ul><ul><ul><li>Benefits </li></ul></ul><ul><ul><ul><li>Very simple to implement and use – single-threaded execution </li></ul></ul></ul><ul><ul><li>Disadvantages </li></ul></ul><ul><ul><ul><li>Poor performance due to high process creation cost </li></ul></ul></ul><ul><ul><ul><li>Creates and passes request data to a new CGI process </li></ul></ul></ul><ul><ul><ul><li>Waits for CGI process to produce response </li></ul></ul></ul><ul><ul><ul><li>Shuts down CGI process </li></ul></ul></ul>
  6. 7. IIS6 Application Framework support <ul><li>Internet Server Application Programming Interface (ISAPI) </li></ul><ul><ul><li>Benefit of ISAPI </li></ul></ul><ul><ul><ul><li>Can be extremely fast when written correctly </li></ul></ul></ul><ul><ul><li>Disadvantage of ISAPI </li></ul></ul><ul><ul><ul><li>Must be thread-safe (many PHP extensions are not!) </li></ul></ul></ul><ul><ul><ul><li>Requires development in C++ </li></ul></ul></ul>
  7. 8. PHP Setup
  8. 9. Per-site PHP configuration Configuring FastCGI process pool < fastCgi > < application fullPath =&quot;C:PHPphp-cgi.exe&quot; arguments =&quot;-d;> < environmentVariables > < environmentVariable name =&quot;PHPRC&quot; value =&quot;C:WebSiteswebsite1&quot; /> </ environmentVariables > </ application > </ fastCgi > Combination of fullPath and arguments uniquely identify FastCGI process pool definition PHPRC environment variable contains path to the php.ini file
  9. 10. IIS Extensions <ul><li>Mod_rewrite support for URL rewriting </li></ul>
  10. 11. SQLServer 2008 <ul><li>Express version with Management Studio </li></ul><ul><ul><li>Free (as in beer) download </li></ul></ul><ul><li>MySQL .NET drivers (data import/export) </li></ul><ul><li>Open source: Microsoft SQLServer Driver for PHP </li></ul>
  11. 12. Resources <ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>