PHP on Windows 2008

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 1 Event

    PHP on Windows 2008 - Presentation Transcript

    1.  
    2. Jorke Odolphi Microsoft Australia web platform architect evangelist [email_address] @jorke
    3. PHP Developers longzheng
    4. So Bacon has feathers now? Contributing to Open Source Open Specification Promise Apache Software Foundation
    5. 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
    6. 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 …
    7. 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
    8. 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++
    9. IIS 7.0 ASP.NET Request Processing
      • Classic Mode
        • runs as ISAPI
      • Integrated Mode
        • .NET modules / handlers plug directly into pipeline
        • Process all requests
        • Full runtime fidelity
      Authorization ResolveCache UpdateCache … … … … aspnet_isapi.dll Log Compress Basic Static File ISAPI Anon SendResponse Authentication ExecuteHandler Authentication Forms Windows Map Handler ASPX Trace …
    10. New Configuration NET global settings .NET Framework Global web.config machine.config IIS 7 applicationHost.config Site Root web.config <system.web> .NET settings .. <system.webServer> IIS 7 Delegated settings ASP.NET global settings Global settings and location tags
    11. PHP Setup
    12. Per-site PHP configuration Configuring FastCGI process pool < fastCgi > < application fullPath =&quot;C:PHPphp-cgi.exe&quot; arguments =&quot;-d my.website=website1&quot;> < 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
    13. Per-site PHP configuration Configuring Handler Mapping < system.webServer > < handlers accessPolicy =&quot;Read, Script&quot;> < add name =&quot;PHP via FastCGI&quot; path =&quot;*.php&quot; verb =&quot;*&quot; modules =&quot;FastCgiModule&quot; scriptProcessor =&quot;C:PHPphp-cgi.exe|-d my.website=website2&quot; resourceType =&quot;Unspecified&quot; requireAccess =&quot;Script&quot; /> </ handlers > </ system.webServer > Reference FastCGI process pool by concatenating [fullPath]|[arguments]
    14. PHP Setup Feature Delegation Remote Administration Web Server Core Integration
    15. Thread safe Non Thread Safe
    16. PHP with FastCGI
      • Zend Collaboration
      • Built in Support for Fast CGI
        • Re-use of processes
      • BIG performance boost
      • Thread Safe vs Non Thread Safe
      Thread Safe Non-Thread Safe
    17. FastCGI Handler Architecture IIS Worker Process Request queue FastCGI process pool for PHP5 php-cgi.exe FastCGI process pool for PHP4 php.exe FastCGI protocol over named pipes or TCP
    18. Best Practices for Running PHP on IIS7
      • Want to set PHP specific environment variables in the web.config file?
        • Use environmentVariables configuration setting to set PHP specific environment variables.
      • <fastCgi>
        • <application fullPath=&quot;C:PHPphp-cgi.exe&quot;
        • instanceMaxRequests=“10000&quot;>
        • <environmentVariables>
        •     <environmentVariable
        • name=”PHP_FCGI_MAX_REQUESTS”
        • value=”10000”/>
        •     </environmentVariables>
        • </application>
      • </fastCgi>
    19. Best Practices for Running PHP on IIS7
      • Is your server under so much load that your clients are getting timeout responses?
        • The FastCGI process will be terminated if it does not respond to FastCGI handler within specified time period.
        • Set the requestTimeout (number of seconds to wait for process to handle the request) value to be higher than the activityTimeout (number of seconds to wait for any process activity) value.
      • <fastCgi>
        • <application fullPath=&quot;C:PHPphp-cgi.exe&quot;
        • activityTimeout=“30&quot;
        • requestTimeout=“90&quot;/>
      • </fastCgi>
    20. Manage CPU utilization
      • Windows Server Resource Manager (WSRM)
        • Available in all SKU’s of WS2008
        • Ensures that process gets *at least* the configured CPU percentage
        • Kicks in only if overall CPU load is more than 70%
      • IIS team tested WSRM with 4000 web sites
    21. Performance Scaling Out WSRM
    22. Performance Best Practices
      • Enable Output Caching for semi-dynamic pages
      • Low bandwidth Branch Offices?
        • Enable Dynamic Compression ( ~ 5% CPU overhead)
      • Need to run many web apps on a single box?
        • Run IIS worker processes in Wow64 mode
          • Room for the OS, scalability for your web apps
          • It’s an per-AppPool setting now: Enable32BitAppOnWow64
      • Thinking about buying new Web Server hardware?
        • W2K8 scales extremely well on new multi-proc boxes (4 and 8 core)
      • ASP.NET op caching vs. IIS op caching vs. KM output caching
    23. Performance Best Practices
      • 1000s of requests per second?
        • Remove modules you don’t need
      • You don’t know why some pages are so slow?
        • Turn on Failed Request Tracing and the “time-taken” feature to investigate
      • You * script-mapped all requests to ASP.NET in IIS6?
        • Integrated Pipeline is much faster than an IIS6 * scriptmap solution
        • Try together with IIS7 URL Authorization.
    24. Performance Best Practices
      • PHP applications?
        • PHP on top of FastCGI is much faster than traditional CGI
      • The majority of your requests go to your Default Document?
        • Put it on top of the list
          • Otherwise IIS7 has to check every time
          • Static default documents will be cached in kernel-mode
      • Looking for tools to measures web server performance?
        • Try WCAT 6.3 from www.iis.net/downloads
    25. Performance Boosting
      • Better compression for static and dynamic
        • Output caching a module
        • Per URL / query string / request headers
        • Huge improvements to allow for high density or high availability
    26. IIS Extensions
      • Mod_rewrite support for URL rewriting
    27. Jorke Odolphi [email_address]
    28. SID Injection AppPool: newPool username: newPoolUser password: <password> LogonUser AccessCheck AccessCheck Service Host (SVCHost.EXE) Windows Process Activation Service (WAS) World Wide Web Service (W3SVC) applicationhost.config Token Token NewPool Wwwroot default.htm ACL OK Otherpool Wwwroot default.htm ACL Denied

    + jorkejorke, 11 months ago

    custom

    1307 views, 1 favs, 0 embeds more stats

    Presentation on PHP on Windows 2008 presented at OS more

    More info about this document

    CC Attribution-NoDerivs LicenseCC Attribution-NoDerivs License

    Go to text version

    • Total Views 1307
      • 1307 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 16
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events