11 views
asked in Windows by
Install and Configure PHP in IIS Manager in Windows Server 2022

1 Answer

answered by

inchirags@gmail.com  Chirag's Windows Tutorial https://www.chirags.in

*********************************************************************************************

Install and Configure PHP in IIS Manager in Windows Server 2022

*********************************************************************************************

https://youtu.be/ZiaVDOZiLWo

The Microsoft Web Platform Installer (WebPI) was retired on December 31, 2022.

Step 1: Microsoft Visual C++ Redistributable latest supported downloads

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022

https://aka.ms/vs/17/release/vc_redist.x64.exe

Step 2: Zip File Installation

To use the Zip file installation, follow the instructions in Using FastCGI to Host PHP Applications on IIS 7.0 and Above. The Zip file installation installs many of the extensions that are available for the Windows Installer version; however, none of the extensions are enabled until their entries in the Php.ini file are set up.

Download the latest non-thread-safe Zip file package with binaries of PHP. Under Windows Binaries, click on the most current "PHP non-thread-safe Zip package" to download the PHP files.

https://www.php.net/downloads.php

https://windows.php.net/downloads/releases/php-8.3.12-nts-Win32-vs16-x64.zip

Unpack the files to a directory of your choice (for example, C:\PHP) on your IIS server.

Step 3: php.ini file configuration

Rename the 

Php.ini-development 

to 

php.ini

Open the Php.ini file in a text editor, then uncomment and modify settings as follows:

Set fastcgi.impersonate = 1

FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under.

Set cgi.fix_pathinfo = 0

The cgi.fix_pathinfo provides PATH_INFO/PATH_TRANSLATED support for Common Gateway Interface (CGI). Setting this to 1 will cause PHP CGI to fix its paths to conform to the specification.

Set cgi.force_redirect = 0

Set open_basedir to point to a folder or network path where the content of the Web site(s) is located.

C:\ApplicationPoolPHP

Set extension_dir to point to a location where PHP extensions reside. For PHP 5.2.X, this is typically 

extension_dir = "./ext"
Set error_log="C:\php_errors.log"

This can help with troubleshooting.

Enable the required PHP extension by un-commenting corresponding lines. More information follows in the section, Extensions.

Step 4: Setting Environment Variables

Click on Start, Settings, Control Panel, and then double-click on the System icon (using the class view).

Click on the Advanced system settings link in the left column.

From the System Properties window, click on the Advanced tab, and then click on the Environment Variables button at the bottom.

Select the Path variable from the System Variables section, and then click on Edit. Add: 

c:\php

to your system path.

Click OK until you have exited the System Properties window.

Step 5: Configure IIS Manager

Server Manager -> Add roles and features -> Role-based or feature-based installation -> Next -> 

select checkbox "Web Server (IIS)" and "CGI" is under the Web Server (IIS) > Application Development section.

-> Next -> Install

Note: Install features as per your requirement.

Step 6: configure Handler Mappings

Start IIS Manager by clicking on Start, Programs, Administrative Tools, and then Internet Information Services (IIS) Manager.

From the IIS Manager, click on the hostname of your server in the Connections panel on the left.

Double-click on the Handler Mappings icon.

From the Handler Mappings Actions panel, click on Add Module Mapping.

Type the following information into the appropriate text boxes, and then click OK.

Request path: *.php
Module : FastCGImodule
Executable: C:\php\php-cgi.exe
Name: FastCGI

Click OK, and then click Yes.

Step 7: Create index.php and default.php pages

In the left panel, click on your server's hostname, and then double-click on the Default Document icon.

From the Actions panel on the right, click Add.

Enter index.php as the new default document name, and then click OK.

Enter default.php as the new default document name, and then click OK.

In the left panel, click on your server's hostname.

In the Actions panel on the right, click Restart.

Step 7: Create phpinfo.php and check the php configurations.

Create a new text document, and save it as 

c:\inetpub\wwwroot\phpinfo.php 

with the following content:

<?php phpinfo(); ?>

You should now see the PHP information page at 

http://localhost/phpinfo.php

For any doubts and query, please write on YouTube video comments section.

Note : Flow the Process shown in video.

Please, Subscribe and like for more videos:

https://www.youtube.com/@chiragstutorial

Don't forget to, Follow, Like, Share &, Comment

Thanks & Regards,

Chitt Ranjan Mahto "Chirag"

_____________________________________________________________________

Note: All scripts used in this demo will be available in our website.

Link will be available in description.

#chirags 

#chiragstutorial 

#chiragsphptutorial

#chiragstutorials

#phptutorial 

#phpwithiis

#php

Most popular tags

postgresql laravel replication ha postgresql laravel-10 mongodb ubuntu 24.04 lts mongodb database mongodb tutorial streaming-replication mysql laravel-11 database laravel postgresql backup database mysql php technlogy asp.net asp.net c# mysql master slave replication centos linux laravel sql server schedule backup autobackup postgresql django python user and admin registration user and admin login multiauth zabbix 7 how to install graylog on ubuntu 24.04 lts | step-by-step asp.net core mvc .net mvc network upload c# ssl integration sql server on ubuntu 22.04 lts mssql server ms sql server sql server user access in postgres mysql password change cent os linux laravel login register logout replica php in iis php with iis php tutorial chirags php tutorials chirags php tutorial chirags tutorial laravel 11 gaurds laravel 11 guards mongodb sharding metabase business analytics metabase ubuntu 24.04 koha 24.05 postgresql 16 to postgresql 17 postgresql migration letsencrypt mongodb crud rocky linux laravel custom captcha laravel 11 captcha laravel captcha mongo dll php.ini debian 12 nginx apache nextcloud gitea in ubuntu git gitea npm error node js mysql ndb cluster mysql cluster ssl oracle login register logout in python debian windows shell batch file bat file time stamp date time shopping cart in laravel centos rhel swap memeory rhel 5.5 access configuration in postgresql hba configuration laravel multiple database configuration state city country dropdown live photo upload webcam captcha in laravel
...