Windows Server – Installing IIS and PHP

KB ID 0000879

Problem

What used to be a complicated task has been simplified greatly by the Microsoft Web Platform installer, the process of adding PHP is the same for Windows 8,(though to install IIS you need to enable that as a windows feature (run appwiz.cpl > Turn Windows feature on or off).

Solution

1. From Server Manager (ServerManager.exe) > Manage > Add Roles and Features > Follow the wizard and in the Server Roles section tick ‘Web Server IIS‘.

Install PHP in Windows Server 2012

2. At the role Services selection expand Application Deployment > Select CGI >Complete the wizard and let the role install.

IIS 8 Install CGI

3. Once complete, open a web page and navigate to http://localhost and you should be greeted with the following.

PHP on IIS 8

4. Download the Microsoft Platform Web Installer.

Web Platform Installer

5. Run the installer > Products > Frameworks > PHP {version} > Add.

Install PHP in Windows Server 2012

6. I Accept > The software will install.

Server 2012 PHP 5.4

7. To test open notepad and create a file with the following;

<?php phpinfo(); ?>

IIS windows 8 php

8. Save the file into {Drive Letter}:inetpubwwwroot > Change the file type to ‘All Files’ > call it phpinfo.php > Save.

Note: The drive letter will usually be C: unless you have moved the IIS root folder.

get php information

9. To test PHP > open a browser and navigate to http://localhost/phpinfo.php > You should see something like the following.

2012 test php

 

Related Articles, References, Credits, or External Links

NA

Author: Migrated

Share This Post On