Php iis microsoft

265 views

Published on

Php iis microsoft

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
265
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Php iis microsoft

  1. 1. MICROSOFT, IIS7 AND PHP Nick Hodge MicrosoftAustralia ProfessionalGeek nhodge@microsoft.com Jorke Odolphi MicrosoftAustralia Web Infrastructure Evangelist jorkeo@microsoft.com
  2. 2. This is not your father’s Microsoft
  3. 3. IIS Request Processing Server functionality is split into ~ 40 modules... Modules plug into a generic request pipeline… Modules extend server functionality through a public moduleAPI. Send Response Log Compress NTLM Basic Determine Handler CGI Static File ISAPI Authentication Anon SendResponse Authentication Authorization ResolveCache ExecuteHandler UpdateCache… … … ASP.NET PHP Monolithic implementation Install all or nothing… Extend server functionality only through ISAPI…
  4. 4. IIS 6.0 ASP.NET Processing Runtime limitations Only sees ASP.NET requests Feature duplication Send Response Log Compress NTLM Basic Determine Handler CGI Static File ISAPI Authentication Anon … … Authentication Forms Windows Map Handler ASPX Trace … … … aspnet_isapi.dll
  5. 5. IIS6 Application Framework support  Common Gateway Interface (CGI) for CGI and PHP applications  Benefits  Very simple to implement and use – single-threaded execution  Disadvantages  Poor performance due to high process creation cost  Creates and passes request data to a new CGI process  Waits for CGI process to produce response  Shuts down CGI process
  6. 6. IIS6 Application Framework support  Internet Server Application Programming Interface (ISAPI)  Benefit of ISAPI  Can be extremely fast when written correctly  Disadvantage of ISAPI  Must be thread-safe (many PHP extensions are not!)  Requires development in C++
  7. 7. PHP Setup Binaries • Use zip file with non-thread safe binaries • OR download PHP installer Configure php.ini • fastcgi.impersonate = 1 • cgi.fix_pathinfo = 1 • open_basedir = “C:inetpubwebsiteFolder” Configure IIS • Enable CGI • Configure FastCGI handler mapping for *.php • Change FastCGI settings Test that it works • C:phpphp-cgi.exe –info • http://localhost/phpinfo.php
  8. 8. Per-site PHP configuration Configuring FastCGI process pool <fastCgi> <application fullPath="C:PHPphp-cgi.exe" arguments="-d my.website=website1"> <environmentVariables> <environmentVariable name="PHPRC" value="C:WebSiteswebsite1" /> </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. 9. IIS Extensions  Mod_rewrite support for URL rewriting
  10. 10. SQLServer 2008  Express version with Management Studio  Free (as in beer) download  MySQL .NET drivers (data import/export)  Open source: Microsoft SQLServer Driver for PHP
  11. 11. Resources http://learn.iis.net http://port25.technet.com http://codeplex.com/ http://port25.technet.com/archive/2008/07/25/osp.aspx

×