How to Install PHP5 IIS 6 Permissions
The PHP hypertext preprocessor is a Web scripting language and runtime used for generating dynamic content. Microsoft's IIS 6 Web server can serve Web pages generated from PHP on a website if PHP is installed on the same server, IIS is configured to use it and the proper permission statements are set. FastCGI impersonation is recommended for PHP. Impersonation allows PHP to run its scripts on behalf of the normal IIS Web server, ensuring PHP5 has proper permissions.
Instructions
-
-
1
Download the latest non-thread-safe PHP5 installer for Windows and install it by following the instructions on your screen (see Resources.)
-
2
Click "Start," click "My Computer" and navigate to the "C:\PHP\" directory.
-
-
3
Double-click the "php.ini" file to open it in Notepad.
-
4
Add the following lines to the end of the php.ini file:
fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo=1
cgi.force_redirect = 0
-
5
Click "File" and "Save," then close Notepad.
-
6
Download and install the Microsoft FastCGI for IIS installer (see Resources.)
-
7
Click "Start," click "Run," type "cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^ -extension:php -path:"C:\PHP\php-cgi.exe"" into the Run dialog box and click "OK." This command configures the FastCGI package to use PHP.
-
8
Click "Start," click "Run," type "icacls C:\inetpub\wwwroot\upload /grant IUSR:(OI)(CI)(M)" into the Run dialog box and click "OK." This command grants the IIS IUSR account its needed permissions.
-
9
Click "Start," click "Run," type "inetmgr" into the Run dialog box and click "OK."
-
10
Right-click "Websites" at the left side of the IIS Manager window and click "Properties."
-
11
Click the "Documents" tab at the top of the Properties window.
-
12
Click "Add," type "index.php" into the "Default Content Page" box and click "OK" twice.
-
1
Tips & Warnings
Use Windows Explorer to grant file permissions to the "IUSR" account in a file or folder's properties window. The IUSR account has no permissions by default, and it needs read permission on every file PHP needs to access. If PHP needs to be able to write files, the IUSR account needs write permissions to those files or folders.