Using ZendPHP with Microsoft IIS

Internet Information Services for Windows Server (IIS) is an extensible web server for hosting your web site using ZendPHP.

Prerequisites

Before you follow this tutorial, verify that you fulfill the following prerequisites:

In this tutorial, we assume that the NTS build of ZendPHP is installed in C:\Program Files\Zend\ZendPHP.

Handler Mapping

To set up the handler mapping for PHP:

  1. Open IIS Manager and select the hostname of the computer in the Connections panel.

  2. Double-click Handler Mappings.

  3. In the Action panel, click Add Module Mapping.

  4. Under Request path, type *.php.

  5. From the Module menu, select FastCGIModule.

  6. Under Executable, type the following path. Enter the PHP major and minor version in place of {MAJOR_VERSION}.{MINOR_VERSION}, for example, 8.2 or 7.4.

    C:\Program Files\Zend\ZendPHP\{MAJOR_VERSION}.{MINOR_VERSION}\php-cgi.exe

  7. Under Name, define a name for your module mapping, for example, ZendPHP.

  8. Click OK.

For more information, see Install IIS and PHP (learn.microsoft.com).

FastCGI Configuration

  1. Open IIS Manager and select the hostname of the computer in the Connections panel.

  2. Edit the FastCGI Settings.

  3. Edit the environment variables.

  4. Add two environment variables and set them to your PHP installation paths:

    • PHPRC=<php.ini.path>
    • PHP_INI_SCAN_DIR=<php.etc.conf.d.path>
  5. Save the changes.

Configure the directory where the PHP extensions are stored:

  1. Open the php.ini file in a text editor.

  2. Change the following line:
    extension_dir = "ext"

  3. Save the file.

Update file access permissions for the C:\Program Files\Zend\ZendPHP\var\* directories so that "Users" have Write access:

  1. Open the Terminal.

  2. Enter the following command:
    cacls.exe "C:\Program files\Zend\ZendPHP\var\*" /e /p Users:f

Default Document

Optionally, set up index.php as a default document:

  1. On the Connections panel, double-click Default Document.

  2. In the Action panel, click Add.

  3. Under Name, type index.php and then click OK.

  4. Click Add again. Under Name, type default.php, and then click OK.