hosting php on iis 7 0 best practices for shared hosting
Download
Skip this Video
Download Presentation
Hosting PHP on IIS 7.0 Best Practices for shared hosting

Loading in 2 Seconds...

play fullscreen
1 / 15

Hosting PHP on IIS 7.0 Best Practices for shared hosting - PowerPoint PPT Presentation


  • 239 Views
  • Uploaded on

Hosting PHP on IIS 7.0 Best Practices for shared hosting. Microsoft® Hosting Deployment Accelerator. Agenda. PHP Setup FastCGI architecture Hosting guidance Multiple PHP versions Per-site PHP configuration Providing URL rewriting Managing CPU usage Summary. PHP setup steps.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Hosting PHP on IIS 7.0 Best Practices for shared hosting' - emory


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
hosting php on iis 7 0 best practices for shared hosting

Hosting PHP on IIS 7.0Best Practices for shared hosting

Microsoft®

Hosting Deployment Accelerator

agenda
Agenda
  • PHP Setup
  • FastCGI architecture
  • Hosting guidance
    • Multiple PHP versions
    • Per-site PHP configuration
    • Providing URL rewriting
    • Managing CPU usage
  • Summary
fastcgi handler architecture
FastCGI Handler Architecture

IIS Worker Process

FastCGI protocol over named pipes or TCP

FastCGI process pool for PHP5

Requestqueue

recommended configuration
Recommended configuration

FastCGI Process Pool

App Pool #1 (user1)

Web site #1

FastCGI Process Pool

App Pool #2 (user2)

Web site #2

FastCGI Process pool

App Pool #N (userN)

Web site #N

recommended configuration1
Recommended configuration
  • Configure security isolation
    • One app pool per web site
    • Enable FastCGI impersonation
  • Prevent failures caused by PHP recycling
    • set PHP_FCGI_MAX_REQUESTS >= instanceMaxRequests
  • For higher site density:
    • use dynamicIdleThreshold
    • reduce idleTimeout
    • reduce maxInstances (may affect performance)
multiple php versions
Multiple PHP versions

Process Pool for PHP 5

App Pool #1 (user1)

Web site #1

C:\PHP526\php-cgi.exe

Process Pool for PHP 4

App Pool #2 (user2)

Web site #2

C:\PHP447\php.exe

per site php configuration configuring fastcgi process pool
Per-site PHP configurationConfiguring FastCGI process pool

Combination of fullPath and arguments uniquely identify FastCGI process pool definition

<fastCgi>

<applicationfullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=website1">

<environmentVariables>

<environmentVariablename="PHPRC" value="C:\WebSites\website1" />

</environmentVariables>

</application>

</fastCgi>

PHPRC environment variable contains path to the php.ini file

per site php configuration configuring handler mapping
Per-site PHP configurationConfiguring Handler Mapping

<system.webServer>

<handlersaccessPolicy="Read, Script">

<addname="PHP via FastCGI" path="*.php"

verb="*" modules="FastCgiModule"

scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=website2"

resourceType="Unspecified" requireAccess="Script" />

</handlers>

</system.webServer>

Reference FastCGI process pool by concatenating [fullPath]|[arguments]

manage cpu utilization
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 with 4000 web sites
best practices summary
Best practices summary
  • Follow IIS 7.0 security isolation guidelines
  • Leverage FastCGI/IIS features to enhance hosting offer:
    • Multiple PHP versions
    • Per-site PHP configuration
    • URL rewriting
  • Use WSRM to manage w3wp.exe and php-cgi.exe CPU utilization

More information at http://learn.iis.net/page.aspx/208/fastcgi-with-php

ad