How to Host a PHP Application on IIS

Hosting a PHP application on IIS (Internet Information Services) is simple. In this brief post, I have explained the steps involved to set up your environment properly. You would learn how to install IIS, PHP, MySQL and how to add a new application or website.

 

A. Install IIS on Windows Server 2012

  1. On the Start page, click the Server Manager tile, and then click OK.

  1. In Server Manager, select Dashboard, and click Add roles and features.

  1. In the Add Roles and Features Wizard, on the Before You Begin page, click Next.

  1. On the Select Installation Type page, select Role-based or Feature-based Installation and click Next

  1. On the Select Destination Server page, select Select a server from the server pool, select your server, and click Next.

  1. On the Select Server Roles page, select Web Server (IIS), and then click Next. Make sure CGI is selected. This selection also installs FastCGI, which is recommended for PHP applications.

  1. On the Select Features page, note the preselected features that are installed by default

  1. Click Next.

  2. On the Web Server Role (IIS) page, click Next.

  3. On the Select Role Services page, note the preselected role services that are installed by default, and then click Next.

  4. On the Confirm Installation Selections page, confirm your selections, and then click Install.

  5. On the Installation Progress page, confirm that your installation of the Web Server (IIS) role and required role services completed successfully, and then click Close.

  6. To verify that IIS installed successfully, type the following into a web browser:

        http://localhost

You should see the default IIS Welcome page.

B. Install PHP, MySQL, PHP Manager for IIS

  1. Use the Microsoft Web Platform Installer to install PHP, MySQL and PHP Manager for IIS

C. Add Your PHP Application

Once you have IIS and PHP installed, you can add a PHP application to your web server. This section describes how to set up your PHP application on an IIS web server with PHP installed. It does not explain how to develop a PHP application.

To add a PHP web application

  1. Open IIS Manager

  1. In the Connections pane, right-click the Sites node in the tree, and then click Add Website.

  2. In the Add Website dialog box, type a friendly name for your website in the Site name box.

  3. If you want to select a different application pool than the one listed in the Application Pool box, click Select. In the Select Application Pool dialog box, select an application pool from the Application Pool list and then click OK.

  4. In the Physical path box, type the physical path of the website’s folder, or click the browse button (…) to navigate the file system to find the folder.

  5. If the physical path that you entered in step 5 is to a remote share, click Connect as to specify credentials that have permission to access the path. If you do not use specific credentials, select the Application user (pass-through authentication) option in the Connect As dialog box.

  6. Select the protocol for the website from the Type list.

  7. The default value in the IP address box is All Unassigned. If you must specify a static IP address for the website, type the IP address in the IP address box.

  8. Type a port number in the Port text box.

  9. Optionally, type a host name for the website in the Host name box.

  10. If you do not have to make any changes to the site, and you want the website to be immediately available, select the Start Web site immediately check box.

  11. Click OK.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *