---
title: 'How to install and configure PHP on Windows Server | Zomro'
description: 'To run PHP scripts on Windows Server, you need to install PHP and perform its initial configuration.'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/28/image-20230628160501-2.jpg'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * How to install and configure PHP on Windows Server 



# How to install and configure PHP on Windows Server

29-06-2023

In this article, we will learn how to install PHP on Windows Server. There are several ways to install PHP, including Microsoft's PHP Manager for IIS, but we will focus on a universal installation method that allows you to install PHP even without being tied to, for example, IIS. Integrating PHP and IIS is not difficult.

## **PHP variants for each version of PHP**

There are two PHP variants for each version of PHP: Non Thread Safe and Thread Safe  
Thread Safe - thread safe. Select this option if PHP is used as mod_php (Apache module). In most cases, in conjunction with the IIS web server, the Thread Safe option is not suitable for the Windows Server operating system.  
Non Thread Safe is a non-thread safe version of PHP. Used in cases where PHP is run via CGI and each thread is a separate CGI process isolated from others and there is no need for thread safety. At the same time, the request processing speed is higher. Non Thread Safe should also be selected if you plan to use FastCGI. Just this mode of operation is recommended to be used in the work of IIS + PHP.

To install PHP of the required version, go to the [PHP for Windows download](http://windows.php.net/download/) page and download the zip archive VS16 x64 Non Thread Safe of the PHP version we need. In this example, we will use PHP8.1

![How to install and configure PHP on Windows Server - 1](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/28/image-20230628160501-2.jpg)

Next, create a folder on the server disk into which you need to unzip the downloaded archive. For example C:\php

![How to install and configure PHP on Windows Server - 2](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/28/image-20230628161617-2.jpg)

In addition, PHP requires the Microsoft Visual Studio package to run on Windows.

Since we chose the VS16 x64 version, on the same page of the site there is a link to download the required version of Microsoft Visual Studio, namely Visual Studio 2015-2019

![How to install and configure PHP on Windows Server - 3](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/28/image-20230628164214-3.jpg)

Download and install: During installation, do not change the proposed settings and wait for completion.

![How to install and configure PHP on Windows Server - 4](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/28/image-20230628170355-4.jpg)

Additionally, it is recommended to set the path to PHP in the global PATH variable. To do this, open the System Properties window: Start - Run and execute the command

> control system

![How to install and configure PHP on Windows Server - 5](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/29/image-20230629121456-1.jpg)

Next, open the Advanced sysytem setting window - Advanced tab - click the Environment Variables button

![How to install and configure PHP on Windows Server - 6](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/29/image-20230629121924-2.jpg)

:Add the path to the folder where PHP is located in the value of the PATH variable. In our case, this is the C:\php folder; (be sure to put a semicolon after the specified path)

![How to install and configure PHP on Windows Server - 7](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/29/image-20230629122424-1.jpg)

Save the changes by clicking OK one by one in the open windows.

## **How to check the installed version of PHP**

To find out the installed version of PHP, in the command line window, run the command

> php -v

![How to install and configure PHP on Windows Server - 8](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a55%40server-panel.net/2023/06/29/image-20230629122936-2.jpg)

In this case, there is no need to change to the C:/php directory, since the path to the PHP executable file was previously added to the environment variables.

  
In this article, we learned how to install PHP of the required version on Windows Server.

We also suggest you other useful articles:

  * [How to install and configure IIS on Windows Server](https://zomro.com/blog/faq/349-kak-ustanovit-i-nastroit-vebserver-iis-php-i-mysql-na-windows-server)
  * [Disable UDP for RDP connections to Windows Server](https://zomro.com/blog/faq/429-dissable-udp-for-rdp-on-windows)
  * [How to install updates on Windows Server 2012, Windows Server 2016, and Windows Server 2019](https://zomro.com/blog/faq/242-kak-ustanovit-obnovlenija-na-windows-server-2012-2016-2019)



Similar articles:

[Using the host command in Linux](https://zomro.com/blog/faq/396-using-the-host-command-in-linux) [How to create a site backup manually](https://zomro.com/blog/faq/206-kak-sozdat-bjekap-sajta-vruchnuju) [How to create a user and add a domain to the HestiaCP panel?](https://zomro.com/blog/faq/247-kak-sozdat-polzovatelja-i-dobavit-domen-v-panel-hestiacp) [How to install Python 3.10 on CentOS 7](https://zomro.com/blog/faq/294-kak-ustanovit-python-310-na-centos-7) [How to enable two-factor authentication in your personal account](https://zomro.com/blog/faq/321-how-to-enable-two-factor-authentication-in-your-personal-account)

[ Forex Server from €7.95/mon ](/server-for-forex)
