PHP Manager for IIS: Quick Setup and Configuration Guide
This guide walks through installing, configuring, and verifying PHP Manager for IIS so you can run PHP sites reliably on Windows Server.
Prerequisites
- Windows Server or Windows ⁄11 with IIS installed and Web Server role enabled.
- Administrator account on the machine.
- PHP runtime (recommended: PHP 7.4, 8.0, or 8.1 — choose a supported build).
- Web Platform Installer (WebPI) or manual download access.
1. Install IIS (if not already)
- Open Server Manager → Manage → Add Roles and Features.
- Select “Web Server (IIS)” role and include these features:
- Web Server → Application Development → CGI
- Management Tools → IIS Management Console
- Complete the wizard and restart if prompted.
2. Install PHP runtime
Option A — Using Web Platform Installer (recommended for simplicity)
- Install WebPI if not present.
- Open WebPI, search for “PHP” and select a supported PHP version (Non-thread safe recommended for FastCGI).
- Install; WebPI configures PHP and FastCGI automatically.
Option B — Manual install
- Download a Thread Safe or Non-Thread Safe ZIP from windows.php.net (Non-TS for FastCGI).
- Extract to C:\PHP.
- Rename php.ini-production to php.ini and enable extensions you need (e.g., extension_dir, php_pdo_mysql).
- Add C:\PHP\ to the system PATH (Control Panel → System → Advanced → Environment Variables).
- Register the PHP CGI executable with IIS (we’ll configure this via PHP Manager below).
3. Install PHP Manager for IIS
Note: PHP Manager may be provided via WebPI or an MSI from official sources. Use WebPI when possible.
- Open Web Platform Installer, search for “PHP Manager for IIS”.
- Click Install and follow prompts. WebPI will add the PHP Manager module to IIS Manager.
If WebPI is unavailable:
- Download the PHP Manager MSI compatible with your IIS version.
- Run the MSI as Administrator and complete installation.
4. Open PHP Manager in IIS Manager
- Open IIS Manager (inetmgr).
- Select the server node in the Connections pane.
- In the Features View, open “PHP Manager”.
5. Register and Configure PHP with PHP Manager
- In PHP Manager, click “Register new PHP version”.
- Browse to php-cgi.exe in your PHP folder (e.g., C:\PHP\8.0\php-cgi.exe) and register. PHP Manager will configure FastCGI settings automatically.
- Confirm PHP shows a green check as the current registered version.
Key PHP Manager settings to check:
- FastCGI process settings: adjust instanceMaxRequests, activityTimeout, requestTimeout if needed.
- php.ini path: ensure PHP Manager points to the php.ini you configured. Use “View phpinfo()” in PHP Manager to confirm loaded configuration file and extensions.
6. Configure Handler Mappings (if needed)
PHP Manager typically creates the.php handler mapping to the registered PHP CGI. To verify:
- In IIS Manager, under the server or site node, open “Handler Mappings”.
- Verify an entry like “*.php” mapped to the FastCGI module and the correct executable path.
- If missing, add a new Module Mapping:
- Request path: *.php
- Module: FastCgiModule
- Executable: C:\PHP\php-cgi.exe
- Name: PHP_v
7. Fine-tune FastCGI and php.ini
- Increase activityTimeout and requestTimeout for long-running scripts.
- Set memory_limit, max_execution_time, upload_max_filesize, post_max_size per your app needs.
- Enable required extensions in php.ini (pdo_mysql, mbstring, curl, etc.). Restart IIS after changes.
8. Test PHP setup
- Create a test file in your site’s wwwroot (e.g., C:\inetpub\wwwroot\info.php) with: “`php
Leave a Reply
You must be logged in to post a comment.