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:
-
Install IIS with the "FastCGI" feature enabled.
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:
-
Open IIS Manager and select the hostname of the computer in the Connections panel.
-
Double-click Handler Mappings.
-
In the Action panel, click Add Module Mapping.
-
Under Request path, type
*.php
. -
From the Module menu, select
FastCGIModule
. -
Under Executable, type the following path. Enter the PHP major and minor version in place of
{MAJOR_VERSION}.{MINOR_VERSION}
, for example,8.2
or7.4
.C:\Program Files\Zend\ZendPHP\{MAJOR_VERSION}.{MINOR_VERSION}\php-cgi.exe
-
Under Name, define a name for your module mapping, for example,
ZendPHP
. -
Click OK.
For more information, see Install IIS and PHP (learn.microsoft.com).
FastCGI Configuration
-
Open IIS Manager and select the hostname of the computer in the Connections panel.
-
Edit the FastCGI Settings.
-
Edit the environment variables.
-
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>
-
Save the changes.
Configure the directory where the PHP extensions are stored:
-
Open the php.ini file in a text editor.
-
Change the following line:
extension_dir = "ext"
-
Save the file.
Update file access permissions for the C:\Program Files\Zend\ZendPHP\var\*
directories so that "Users" have Write access:
-
Open the Terminal.
-
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:
-
On the Connections panel, double-click Default Document.
-
In the Action panel, click Add.
-
Under Name, type
index.php
and then click OK. -
Click Add again. Under Name, type
default.php
, and then click OK.