You are currently viewing How to deploy a PHP website to IIS using Advanced Installer

How to deploy a PHP website to IIS using Advanced Installer

1. Adding the PHP and the website resource files

The first step to create the installation package is to add the website resources in the Files and Folders page.

Because the content of this folder might change during the development process certain files must be included or excluded in the Advanced Installer project, making it difficult to track these changes. You can automate this step by using the folder synchronization feature from Advanced Installer. Aditional information about how synchronized folders work is available in the Working with Synchronized Folders article.

Thus, in the Application Folder view from the Files and Folders page, you can create a regular folder. You can synchronize this folder with the content of the directory where website resources are located. Repeat this step in order to add the PHP resources files to the installation package.

After this step, your project’s Files and Folders view should look as follows:

How to deploy a PHP website to IIS using Advanced Installer

2. Create the Application Pool

It’s good practice to make sure that your websites will run under their own application pool; using the Default App Pool might prevent websites from running as expected. To create an application pool for the website you can use the [ New Application Pool ] toolbar button from the IIS view.

3. Create the website onĀ the IIS page

Since the content of the website has been added to the project, it is time to create the website. In the IIS view, you can create a new website using the [ New Web Site ] toolbar button. When prompted, please select the previously created folder from the Application Folder view as the website’s physical folder. The website should look like this:

How to deploy a PHP website to IIS using Advanced Installer

In the Application Mappings tab of the website you need to use php-cgi.exe ( from the PHP Resources folder ) and select the FastCGI module for handling .php requests. Additional settings for the FastCGI application can be configured for the Global Settings IIS tree node using the Application properties dialog from the FastCGI Settings tab.

Next, we need to enable the Use installed application pool option from the Application Pool tab and select the previously created pool.

Another necessary step to get everything working is to add the index.php document in the Default Document tab of the website. Just create a new document using the [ Add ] button and name it index.php.

4. Enabling the required IIS Windows Features

Starting with Windows Vista, IIS comes out of the box as a set of optional Windows Features.

All we have to do is enable the IIS features using a Windows Feature Bundle. To do this, we simply use the [ New Windows Feature Bundle ] from the Prerequisites view of Advanced Installer. We can select the Target Operating Systems for the windows feature, according to our scenario.

For our particular scenario we will select only the Default Document feature. Please use the right top filter to search for the Default Document Windows Feature:

How to deploy a PHP website to IIS using Advanced Installer

5. Launch the website at the end of the installation process

If your scenario requires launching the website in a browser at the end of the installation process, you can use the predefined Open URL custom action as a custom action with sequence:

How to deploy a PHP website to IIS using Advanced Installer

Below there is a short video with the above steps.