install and configure php _ the official microsoft iis site
TRANSCRIPT
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
1/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
Sign In | Join
Home › Learn › Application Frameworks › Chapter 3. Install and Configure PHP on IIS › Install and Configure PHP
By Tali Smith | November 15, 2009
Install and Configure PHP
Introduction
The fastest and easiest way to install PHP on Internet Information Services IIS is by using the
Microsoft® Web Platform Installer Web PI
. Web PI completely automates setting up IIS, FastCGI,
and the latest version of PHP from the php.net Web site. With Web PI, you can navigate to the
“Web Platform” tab and select “PHP” under “Framework and Runtimes” customize link. Alternately,
use the instructions that follow as guidance for installing PHP with Windows® Installer or using a
compressed Zip
file installation.
There are two builds for each PHP version: one is thread‐safe, and one is not referred to as the
non‐thread‐safe [NTS] version
. The thread‐safe version is designed for environments where the
Web server core can keep the PHP engine in memory, running multiple treads of execution for
diff erent Web requests simultaneously. The architecture of IIS and the FastCGI extension provide
an isolation model that keeps requests separate, removing the need for a thread‐safe version. The
NTS version does not have any of the code that allows PHP to manage multiple threads. As a
result, there is a performance improvement on IIS when using the NTS version when compared to
the tread‐safe version because the NTS version avoids unnecessary thread‐safety checks FastCGI
ensures a single‐threaded execution environment .
Install PHP
There are two main ways to install PHP on a Windows®‐based computer: download the Windows
Installer or use the Windows Zip file from the PHP Web site. Either method will get PHP working,
but both have some extra steps that are needed to make PHP work well.
Windows Installer
The Windows Installer version can get a complete PHP environment up and running, but the
installation of extensions can be confusing. By default, no extensions are installed, and this can
adversely affect the usefulness of the PHP installation. Alternately, all of the extensions can be
installed; this results in an unstable system because some of the extensions can conflict with
others. It is generally easier to use the Zip file installation.
Zip File Installation
To use the Zip file installation, follow the instructions in Using FastCGI to Host PHP Applications on
IIS 7.0 and Above. The Zip file installation installs many of the extensions that are available for the
Windows Installer version; however, none of the extensions are enabled until their entries in the
Php.ini file are set up.
Table of Contents
Building and Running ASP.NET Applications
Running Classic ASP Applications on IIS 7 and
IIS 8
Search all of IIS.NET
Home Downloads e rn Reference Blogs Forums
Get Started Install Manage Develop Publish Troubleshoot Extensions Media Application Frameworks Web Hosting
Using ASP.NET Forms Authentication
ASP.NET Integration with IIS 7
How to Take Advantage of the IIS 7.0
Integrated Pipeline
How to Capture ASP.NET Page Trace Events
in IIS 7.0 Tracing
Upgrading ASP.NET 1.1 to IIS 7.0 on
Windows Vista and Windows Server 2008
ASP.NET 2.0 Breaking Changes on IIS 7.0
Wildcard script mapping and IIS 7 integrated
pipeline
How to use the Sample Read-Only XML
Membership and Role Providers with IIS 7.0
ASP.NET Technical Resources
Classic ASP Not Installed by Default on IIS 7.0
and above
Using Classic ASP with Microsoft Access
Databases on IIS
Classic ASP Script Error Messages No Longer
Solutions
http://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-technical-resourceshttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-technical-resourceshttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/using-aspnet-forms-authenticationhttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/using-aspnet-forms-authenticationhttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/using-aspnet-forms-authenticationhttp://engine.adzerk.net/r?e=eyJhdiI6NzczODEsImF0Ijo1LCJidCI6MCwiY20iOjM4MzE5NiwiY2giOjQ4MTEsImNrIjp7fSwiY3IiOjE0MzI3NjAsImRpIjoiYTIwZDI3ZDBlYjI0NGZkM2I4NjAzM2I2YzE3Njg1NDAiLCJkbSI6MSwiZmMiOjE2NDY5MzMsImZsIjoxMjQ4MDA2LCJpcCI6IjE3MS4yNTEuNDkuMTQiLCJudyI6MjA3MiwicGMiOjEwLjUsImVjIjoxMC41LCJwciI6Nzg0NCwicnQiOjIsInJmIjoiaHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS52bi8iLCJzdCI6MTgwOTgsInVrIjoidWUxLTllZGZiZjgxMjE0YT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WdlZC1TZXJ2aWNlcy5odG1sP2NhbXBhaWduPWlpcyJ9&s=83iWA4wa5hRHDdXrOtQ9dDkRz98http://www.iis.net/http://www.iis.net/learnhttp://www.iis.net/learn/application-frameworkshttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iishttp://www.iis.net/https://login.iis.net/login/signin.aspx?ReturnUrl=//www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-phphttps://login.iis.net/login/createuser.aspx?ReturnUrl=//www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-phphttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-defaulthttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iishttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iishttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-defaulthttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iishttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iishttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-technical-resourceshttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/how-to-use-the-sample-read-only-xml-membership-and-role-providers-with-iishttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/wildcard-script-mapping-and-iis-integrated-pipelinehttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-20-breaking-changes-on-iishttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/upgrading-aspnet-11-to-iis-on-windows-vista-and-windows-server-2008http://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/how-to-capture-aspnet-page-trace-events-in-iis-tracinghttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/how-to-take-advantage-of-the-iis-integrated-pipelinehttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-integration-with-iishttp://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/using-aspnet-forms-authenticationhttp://www.iis.net/learn/web-hostinghttp://www.iis.net/learn/application-frameworkshttp://www.iis.net/learn/mediahttp://www.iis.net/learn/extensionshttp://www.iis.net/learn/troubleshoothttp://www.iis.net/learn/publishhttp://www.iis.net/learn/develophttp://www.iis.net/learn/managehttp://www.iis.net/learn/installhttp://www.iis.net/learn/get-startedhttp://www.iis.net/http://forums.iis.net/http://blogs.iis.net/http://www.iis.net/configreferencehttp://www.iis.net/learnhttp://www.iis.net/downloadshttp://www.iis.net/http://engine.adzerk.net/r?e=eyJhdiI6NzczODEsImF0Ijo1LCJidCI6MCwiY20iOjM4MzE5NiwiY2giOjQ4MTEsImNrIjp7fSwiY3IiOjE0MzI3NjAsImRpIjoiYTIwZDI3ZDBlYjI0NGZkM2I4NjAzM2I2YzE3Njg1NDAiLCJkbSI6MSwiZmMiOjE2NDY5MzMsImZsIjoxMjQ4MDA2LCJpcCI6IjE3MS4yNTEuNDkuMTQiLCJudyI6MjA3MiwicGMiOjEwLjUsImVjIjoxMC41LCJwciI6Nzg0NCwicnQiOjIsInJmIjoiaHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS52bi8iLCJzdCI6MTgwOTgsInVrIjoidWUxLTllZGZiZjgxMjE0YTQxZThhYjMzMjk1MTI1NjVhNjc5Iiwiem4iOjEyNjkzLCJ0cyI6MTQ2NDU5MDA3MjAxNywiYmYiOnRydWUsInBuIjoiRmVhdHVyZWRBZCIsInVyIjoiaHR0cDovL2xhbmRpbmcuYml0dGl0YW4uY29tL0lJU19EaWZmZXJlbnRpYXRlLVlvdXItTWFuYWdlZC1TZXJ2aWNlcy5odG1sP2NhbXBhaWduPWlpcyJ9&s=83iWA4wa5hRHDdXrOtQ9dDkRz98http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iishttp://www.php.net/downloads.phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iishttp://www.iis.net/learn/application-frameworkshttp://www.iis.net/learnhttp://www.iis.net/https://login.iis.net/login/createuser.aspx?ReturnUrl=//www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-phphttps://login.iis.net/login/signin.aspx?ReturnUrl=//www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
2/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
1. Download the latest non‐thread‐safe Zip file package with binaries of PHP. Under Windows
Binaries, click on the most current PHP non‐thread‐safe Zip package to download the PHP files.
2. Unpack the files to a directory of your choice for example, C:\PHP on your IIS server.
3. Rename the Php.ini‐recommended to php.ini.
4. Open the Php.ini file in a text editor, then uncomment and modify settings as follows:
a. Set fastcgi.impersonate = 1.
FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This
allows IIS to define the security context that the request runs under.
b. Set cgi.fix_pathinfo=0
The cgi.fix_pathinfo provides PATH_INFO/PATH_TRANSLATED support for Common Gateway
Interface CGI . Setting this to 1 will cause PHP CGI to fix its paths to conform to the specification.
c. Set cgi.force_redirect = 0.
d. Set open_basedir to point to a folder or network path where the content of the Web site s is
located.
e. Set extension_dir to point to a location where PHP extensions reside. For PHP 5.2.X, this is
typically extension_dir = "./ext" .
f. Set error_log=”C:php_errors.log”
This can help with troubleshooting.
g. Enable the required PHP extension by un‐commenting corresponding lines. More information
follows in the section, Extensions.
Figure 1 Windows extensions
5. Click on Start, Settings, Control Panel, and then double‐click on the System icon using the class
view
.
6. Click on the Advanced system settings link in the left column.
7. From the System Properties window, click on the Advanced tab, and then click on the
Install and Configure PHP on IIS
Shown in Web Browser by Default
Using Failed Request Tracing to troubleshoot
Classic ASP errors
Classic ASP parent paths are disabled by
default
APPL_PHYSICAL_PATH Server Variable on
Windows Vista RTM
Classic ASP Applications on IIS 7.0 and IIS 7.5
Overview
Scenario: Build a Classic ASP Website on IIS
Configuring the FastCGI Extension for IIS 6.0
Installing PHP on Windows Vista with
FastCGI
Setting Up a Database for a PHP Application
on IIS
Install PHP and FastCGI Support on Server
Core
Install and Configure MySQL for PHP
Applications on IIS 7
Walkthrough - Set Up MySQL 5.1 for PHP
applications
Install the SQL Server Driver for PHP
Enable FastCGI Support in IIS 7 on Windows
Server 2008, Windows Server 2008 R2,
Windows Vista, or Windows 7
Install and Configure SQL Server 2008 for
PHP Applications on IIS 7
Install and Configure PHP
How to Install the Microsoft Web Platform
for PHP
Using PHP Manager for IIS to setup and
configure PHP
Use the Windows Cache Extension for PHP
Enable Per-Site PHP Configuration on IIS 7
and IIS 6.0
Create a Separate Site or Virtual Directory for
PHP Content
Configure SMTP E-Mail in IIS 7
How to Configure and Optimize the
Microsoft Web Platform for PHP
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/how-to-configure-and-optimize-the-microsoft-web-platform-for-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/configure-smtp-e-mail-in-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/create-a-separate-site-or-virtual-directory-for-php-contenthttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/enable-per-site-php-configuration-on-iis-60-and-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/use-the-windows-cache-extension-for-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/using-php-manager-for-iis-to-setup-and-configure-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/how-to-install-the-microsoft-web-platform-for-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-sql-server-2008-for-php-applications-on-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/enable-fastcgi-support-in-iis-7-on-windows-server-2008-windows-server-2008-r2-windows-vista-or-windows-7http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-the-sql-server-driver-for-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/walkthrough-set-up-mysql-51-for-php-applicationshttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-mysql-for-php-applications-on-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-php-and-fastcgi-support-on-server-corehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/setting-up-a-database-for-a-php-application-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/installing-php-on-windows-vista-with-fastcgihttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/configuring-the-fastcgi-extension-for-iis-60http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/scenario-build-a-classic-asp-website-on-iishttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-applications-on-iis-overviewhttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/applphysicalpath-server-variable-on-windows-vista-rtmhttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-parent-paths-are-disabled-by-defaulthttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-failed-request-tracing-to-troubleshoot-classic-asp-errorshttp://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-defaulthttp://media-www-iis.azureedge.net/media/7187228/install-and-configure-php-724-image001.jpghttp://www.php.net/downloads.php
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
3/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
Environment Variables button at the bottom.
8. Select the Path variable from the System Variables section, and then click on Edit. Add: c:\php to
your system path.
Figure 2: Edit System Variable
9. Click OK until you have exited the System Properties window.
10. Start IIS Manager by clicking on Start, Programs, Administrative Tools, and then Internet
Information Services IIS
Manager.
11. From the IIS Manager, click on the hostname of your server in the Connections panel on the
left.
12. Double‐click on the Handler Mappings icon.
Figure 3: Internet Information Services (IIS) Manager
13. From the Handler Mappings Actions panel, click on Add Module Mapping.
Install and Configure PHP Applications on IIS
Run Multiple Versions of PHP on IIS
Improve PHP Error Messages in IIS 7
How to Manage and Administer the
Microsoft Web Platform
Secure Your SQL Server Database
Secure Content in IIS Through Impersonation
Secure PHP with Configuration Settings
Secure Your Infrastructure and PHP
Applications
How to Secure the Microsoft Web Platform
Enable PHP Applications to Make
Application-Level Access Control Decisions
Advanced Poll on IIS
b2Evolution on IIS
Coppermine on IIS
Crafty Syntax Live Help on IIS
Gallery2 on IIS
Geeklog on IIS
Mambo on IIS
Install WordPress on IIS
XOOPS on IIS
MediaWiki on IIS
Install osCommerce on IIS
PHPNuke on IIS
Install Zen Cart on IIS
CubeCart on IIS
ExpressionEngine on IIS
LimeSurvey on IIS
OpenAds on IIS
PHPList on IIS
PHProjekt on IIS
Siteframe on IIS
http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/siteframe-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/phprojekt-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/phplist-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/openads-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/limesurvey-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/expressionengine-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/cubecart-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/install-zen-cart-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/phpnuke-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/install-oscommerce-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/mediawiki-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/xoops-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/install-wordpress-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/mambo-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/geeklog-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/gallery2-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/crafty-syntax-live-help-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/coppermine-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/b2evolution-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/advanced-poll-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/enable-php-applications-to-make-application-level-access-control-decisionshttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/how-to-secure-the-microsoft-web-platformhttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/secure-your-infrastructure-and-php-applicationshttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/secure-php-with-configuration-settingshttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/secure-content-in-iis-through-impersonationhttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/secure-your-sql-server-databasehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/how-to-manage-and-administer-the-microsoft-web-platformhttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/improve-php-error-messages-in-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/run-multiple-versions-of-php-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/how-to-configure-and-optimize-the-microsoft-web-platform-for-phphttp://media-www-iis.azureedge.net/media/7187216/install-and-configure-php-724-image003.jpghttp://media-www-iis.azureedge.net/media/7187222/install-and-configure-php-724-image002.jpg
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
4/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
Figure 4: Handler Mappings
14. Type the following information into the appropriate text boxes, and then click OK.
Request path: *.php
Module: FastCGImodule
Executable: C:\php\php‐cgi.exe
Name: FastCGI
Figure 5: Add Script Map
15. Click OK, and then click Yes.
16. In the left panel, click on your server’s hostname, and then double‐click on the Default
Document icon.
17. From the Actions panel on the right, click Add.
18. Enter index.php as the new default document name, and then click OK.
19. Enter default.php as the new default document name, and then click OK.
20. In the left panel, click on your server’s hostname.
Running PHP Applications on IIS
Scenario: Build an ASP.NET Website on IIS
PHPWCMS on IIS
pMachinePro on IIS
Install Drupal on IIS
Install Joomla! on IIS
Using FastCGI to Host PHP Applications on
IIS 7
Using FastCGI to Host PHP Applications on
IIS 6.0
Translate .htaccess Content to IIS web.config
Provide URL Rewriting Functionality
How to Deploy Applications on the Microsoft
Web Platform for PHP
MIX08: Partying with PHP on Microsoft
Internet Information Services 7
Set Up FastCGI for PHP
Build a High-Performance PHP Stack with
Windows IIS and Zend Server
Configure PHP Process Recycling Behavior
Best Practices for PHP on the Microsoft Web
Platform
Provision Web Sites for PHP Applications
Using Managed Code
Develop on IIS 7
Enable PHP Syntax Highlighting on IIS 7
How to Develop on the Microsoft Web
Platform
Overview: Build an ASP.NET Website on IIS
Plan an ASP.NET Website on IIS
Planning Step 1: Plan IIS Web Server and
ASP.NET Modules Installation
Planning Step 2: Plan ASP.NET Settings
Planning Step 3: Plan Data Source Settings
Planning Step 4: Plan Application Security
http://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/planning-step-4-plan-application-securityhttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/planning-step-3-plan-data-source-settingshttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/planning-step-2-plan-asp-net-settingshttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/planning-step-1-plan-iis-web-server-and-asp-net-modules-installationhttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/plan-an-asp-net-website-on-iishttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/overview-build-an-asp-net-website-on-iishttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/how-to-develop-on-the-microsoft-web-platformhttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/enable-php-syntax-highlighting-on-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/develop-on-iis-7-and-abovehttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/provision-web-sites-for-php-applications-using-managed-codehttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/best-practices-for-php-on-the-microsoft-web-platformhttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/configure-php-process-recycling-behaviorhttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/build-a-high-performance-php-stack-with-windows-iis-and-zend-serverhttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/set-up-fastcgi-for-phphttp://www.iis.net/learn/application-frameworks/running-php-applications-on-iis/mix08-partying-with-php-on-microsoft-internet-information-services-7-and-abovehttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/how-to-deploy-applications-on-the-microsoft-web-platform-for-phphttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/provide-url-rewriting-functionalityhttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/translate-htaccess-content-to-iis-webconfighttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis-60http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/install-joomla-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/install-drupal-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/pmachinepro-on-iishttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/phpwcms-on-iishttp://media-www-iis.azureedge.net/media/7187204/install-and-configure-php-724-image005.gifhttp://media-www-iis.azureedge.net/media/7187210/install-and-configure-php-724-image004.jpg
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
5/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
21. In the Actions panel on the right, click Restart.
22. Create a new text document, and save it as c:\inetpub\wwwroot\phpinfo.php with the following
content:
23. You should now see the PHP information page at http://localhost/phpinfo.php.
Figure 6: PHP information page
Extensions
It is important to determine which extensions are needed by the applications that will be running
and then to limit the installed extensions to only those. For a typical open‐source application
installation, for example, the following extensions are installed:
Database Extensions—Most open‐source applications that use MySQL for a database
engine use either the php_mysql or the php_mysqli extensions. For new development work,
either of these extensions work well, or consider using the PDO versions of the MySQL
driver PDO is a PHP extension providing a data‐access abstraction layer that can be used
with a variety of databases ; this extra layer of abstraction provides a richer set of object
database functionality and controls. If Microsoft® SQL Server® or an express version, such
as Microsoft® SQL Server® 2008 Express or Microsoft® SQL Server® 2005 Express Edition
is the database engine, use the php_mssql extension for open‐source applications. For new
development work, use the PDO version of the SQL driver.
Image Handling Extensions—Many of the open‐source applications that enable work with
images make use of the GD2 extension – php_gd2, which has a number of good basic
image manipulation application programming interfaces APIs
. Some applications use the
ImageMagick application and libraries. There is also a php_exif library for working with the
extended information that modern digital cameras store within the images.
Internationalization and Localization Extensions—The two most commonly used extensions
for i18n and l10n are php_mbstring Multi‐Byte String and php_gettext Native Language
Microsoft® Translator
Scenario: Build a PHP Website on IIS
SPONSOR: Host 10 ASP.NET web sites for free.
Translate this page
Spanish
Configure an ASP.NET Website on IIS
Configuring Step 1: Install IIS and ASP.NET
Modules
Configuring Step 2: Configure ASP.NET
Settings
Configuring Step 3: Configure Data Source
Settings
Configuring Step 4: Configure Application
Security
Overview: Build a PHP Website on IIS
Plan a PHP Website on IIS
Planning Step 1: Plan IIS Web Server and PHP
Installation
Planning Step 2: Plan PHP Settings
Planning Step 3: Plan PHP Application
Security
Configure a PHP Website on IIS
Configuring Step 1: Install IIS and PHP
Configuring Step 2: Configure PHP Settings
Configuring Step 3: Configure PHP
Application Security
mailto:?charset=utf-8&subject=Check%20out%20this%20page%20in%20Spanish%20translated%20from%20English&body=Translated%3A%20http%3A%2F%2Fwww.iis.net%2Flearn%2Fapplication-frameworks%2Finstall-and-configure-php-on-iis%2Finstall-and-configure-php%23mstto%3Des%0D%0AOriginal%3A%20http%3A%2F%2Fwww.iis.net%2Flearn%2Fapplication-frameworks%2Finstall-and-configure-php-on-iis%2Finstall-and-configure-php%0D%0A%0D%0AAutomatic%20translation%20powered%20by%20Microsoft%C2%AE%20Translator%0D%0Ahttp%3A%2F%2Fwww.bing.com%2Ftranslatorhttp://www.microsofttranslator.com/widget/?ref=MSTWidgethttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-3-configure-php-application-securityhttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-2-configure-php-settingshttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-phphttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/configure-a-php-website-on-iishttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/planning-step-3-plan-php-application-securityhttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/planning-step-2-plan-php-settingshttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/planning-step-1-plan-iis-web-server-and-php-installationhttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/plan-a-php-website-on-iishttp://www.iis.net/learn/application-frameworks/scenario-build-a-php-website-on-iis/overview-build-a-php-website-on-iishttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-4-configure-application-securityhttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-3-configure-data-source-settingshttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-2-configure-asp-net-settingshttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-moduleshttp://www.iis.net/learn/application-frameworks/scenario-build-an-aspnet-website-on-iis/configure-an-asp-net-website-on-iishttp://%20translate%20this%20page/http://engine.adzerk.net/r?e=eyJhdiI6MTA4MDEsImF0IjozNDgsImJ0IjowLCJjbSI6MzQ0ODEzLCJjaCI6NDgxMSwiY2siOnt9LCJjciI6Njk4NDcwLCJkaSI6IjgwODIxMzlmZjFkODRlNzc4ZTIxMWZmOGFiMTU1MDU2IiwiZG0iOjEsImZjIjoxMzc1NjgxLCJmbCI6OTY4ODM2LCJpcCI6IjE3MS4yNTEuNDkuMTQiLCJudyI6MjA3MiwicGMiOjAsImVjIjowLCJwciI6Nzc2MCwicnQiOjEsInJmIjoiaHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS52bi8iLCJzdCI6MTgwOTgsInVrIjoidWUxLTllZGZiZjgxMjE0YTQxZThhYjMzMjk1MTI1NjVhNjc5IiwidHMiOjE0NjQ1OTAwNzIwMTksImJmIjp0cnVlLCJwbiI6Ik1pY3JvVGV4dEFkIiwidXIiOiJodHRwOi8vd3d3LndpbmRvd3NhenVyZS5jb20vZW4tdXMvZGV2ZWxvcC9uZXQvYXNwbmV0Lz9XVC5tY19pZD1BQjZGQTAxNDAifQ&s=0m_K0Uimeo9qksS8aKgarExe07Ahttp://www.bing.com/translator?ref=MSTWidgethttp://www.imagemagick.org/script/index.phphttp://media-www-iis.azureedge.net/media/7187198/install-and-configure-php-724-image006.jpg
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
6/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
Support
. Many of the open‐source applications use one or both of these.
Web Services Extensions—Choose the Web services extensions based on the services
desired. For PHP, the SOAP extension is widely used. The XML‐RPC extension is often used
in conjunction with SOAP and other services.
PHP.INI File Settings
The Php.ini file provides PHP with configuration and environmental information. Below are a
number of settings for the Php.ini file that help PHP work better with Windows.
REQUIRED SETTINGS:
extension_dir =
The extension_dir needs to point to the directory where the PHP extensions are stored. The
path can be fully qualified for example, C:\PHP\ext
or relative for example, .\ext
.
Extensions that are specified lower in the Php.ini file need to be located in the extension_dir.
If the extensions specified are not in the extension_dir, then PHP will give a warning
message at the start of script execution, and the application may show errors because of the
missing functionality.
extension = xxxxxx.dll
For each extension enabled, a corresponding extension= directive that tells PHP which
extensions in the extension_dir to load at startup time is necessary.
log_errors=On
PHP errors can also go through the PHP error logging facility. This can be used to send
errors to a file or to a service for example, syslog
and works with the error_log directive
described below. When running under IIS, log_errors must be enabled with a valid error_log.
Otherwise, FastCGI considers any startup messages which may be benign as an error
condition, which generates an HTTP 500 return error code to the browser.
error_log=
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
7/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
OPTIONAL SETTINGS:
max_execution_time=##
This directive sets the maximum amount of time that can be taken executing any given
script. The default is 30 seconds. Some applications need more time to process batch
operations for example, Gallery2 loading multiple images from a remote location
.
However, setting the execution time higher than 300 seconds is not advised because there
are often other parts of the connection that cannot support such a long execution time.
memory_limit=###M
The amount of memory available for the PHP process in MB
. The default is 128 MB, which
is appropriate for most PHP applications.
display_errors=Off
This directive determines whether to include any error messages in the stream that it returns
to the Web server. If turned on, PHP will send the classes of errors that are defined with the
error_reporting directive back to IIS as part of the error stream. Many of the open‐source
applications bypass error reporting by executing commands prefaced with @. This allows
the applications to control error handling.
Mail functions
PHP is configured by default to send outbound mail through an SMTP server located on the
same system as the Web server. Note that most Windows installations usually have the Web
and mail servers on separate systems.
Enable PHP Session State
1. In Windows® Explorer, create the session subdirectory in the PHP installation directory.
2. Right‐click the session directory, and select Properties.
3. In the Security tab, click Edit.
4. Click Add, and enter IIS_IUSRS for Enter the object names to select.
5. Click OK.
6. Select the Modify permission check box, and click OK.
Figure 7: Permissions for session folder
7. Click OK in the Session Properties window.
8. Open php.ini in the PHP installation directory, and set the session.save_path setting to the
session subdirectory:
session.save_path = "C:\php\session"
9. Save and close the file.
10. Click Start, and then select Command Prompt.
11. Type runas /user:administrator cmd.exe to enable elevated permissions.
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
8/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/install-and-configure-php
12. Type iisreset at the command prompt, and then press the ENTER key.
Figure 8: IISRESET command
Note that PHP uses file‐based session state by default. You can modify a number of additional
session settings, including whether cookie or URL sessions should be used, and whether sessions
are created on the first request or need to be explicitly created.
13. Test the session state by using Windows Explorer, navigate to C:\inetpub\wwwroot.
14. Create a folder and rename it phpapp.
15. Create session.php in the phpapp directory.
16. Paste the following into it:
17. Save and close the file.
18. Start Internet Explorer, and navigate to http://localhost/session.php.
Figure 9: Using session state
19. Observe that the counter is 1.
20. Request http://localhost/session.php again, or press F5.
Figure 10: Using session state
21. Observe that the counter is 2.
Note: This article uses information from “Using FastCGI to Host PHP Applications on IIS 7.0 and
Above” by Ruslan Yakushev, published on December 5, 2007.
Links for Further Information
PHP on Windows Training Kit.
Installing PHP on Windows Server 2008.
PHP on IIS7.
http://php.iis.net/http://www.microsoft.com/video/en/us/details/7293e003-91c5-4e50-a3c9-ff47b3c62bbchttp://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c8498c9b-a85a-4afa-90c0-593d0e4850cbhttp://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis#InstallPHPhttp://media-www-iis.azureedge.net/media/7187180/install-and-configure-php-724-image009.gifhttp://media-www-iis.azureedge.net/media/7187186/install-and-configure-php-724-image008.jpg
-
8/16/2019 Install and Configure PHP _ the Official Microsoft IIS Site
9/9
5/30/2016 Install and Configure PHP : The Official Microsoft IIS Site
http://www iis net/learn/application frameworks/install and configure php on iis/install and configure php
Discuss in IIS Forums
Deploying IIS 7.5 + FASTCGI + PHP on Server Core.
BY TALI SMITH
Tali Smith is a technical writer at Prowess Consulting, a Seattle‐based IT
software and services firm with expertise in Microsoft technologies.
This site is managed for Microsoft by Neudesic, LLC. | © 2016 Microsoft. All rights reserved.
Privacy Statement | Terms of Use | Contact Us | Advertise With Us | Hosted on Microsoft Azure
Follow us on:
Feedback on IIS | Powered by IIS8
http://www.iis.net/learnhttp://forums.iis.net/1080.aspxhttp://microsoft.com/http://facebook.com/inetsrv/http://www.twitter.com/inetsrv/http://azure.microsoft.com/http://www.neudesicmediagroup.com/?site=iis#contactushttp://www.iis.net/contacthttp://www.iis.net/terms-of-usehttp://www.iis.net/privacyhttp://engine.adzerk.net/r?e=eyJhdiI6ODY2NSwiYXQiOjQsImJ0IjowLCJjbSI6NDA1ODc0LCJjaCI6NDgxMSwiY2siOnt9LCJjciI6MTQxOTMxMSwiZGkiOiI3OTZhOWJhNDAwZTA0ZTE2OGRhNWM3ZGY2ODE1YWE2NSIsImRtIjoxLCJmYyI6MTY1NDU1NywiZmwiOjE0NzEwNDQsImlwIjoiMTcxLjI1MS40OS4xNCIsIm53IjoyMDcyLCJwYyI6NTAwMC4wNCwiZWMiOjUwMDAuMDQsInByIjo3ODQ0LCJydCI6MSwicmYiOiJodHRwczovL3d3dy5nb29nbGUuY29tLnZuLyIsInN0IjoxODA5OCwidWsiOiJ1ZTEtOWVkZmJmODEyMTRhNDFlOGFiMzMyOTUxMjU2NWE2NzkiLCJ0cyI6MTQ2NDU5MDA3MjAxOSwiYmYiOnRydWUsInBuIjoiQm90dG9tQWQiLCJ1ciI6Imh0dHA6Ly90ZXIubGkvdXozd2VsIn0&s=XNRw2aELyZgcYAB8mvJCyFL1gtYhttp://blogs.msdn.com/philpenn/archive/2009/07/19/deploying-iis-7-5-fastcgi-php-on-server-core.aspxhttp://forums.iis.net/1102.aspx