Installing PHP on Windows Server

Installing PHP on Windows Server

PHP is the most common server-side programming language on the web. PHP is usually pre-installed on servers by most web hosting providers. A simple learning path, close relationships with the MySQL database, and a great collection of libraries will save you time on the path to becoming a developer. php may not be great, but it will certainly be a good option for your second learning application. You can choose your perfect Windows VPS Server Packages from eldernode to install windows server.

This article explains how to install and test PHP on Windows Server. Installing PHP on a Windows server allows you to safely create and test a web application without having to worry about affecting the data or system on your website. This tutorial uses the Microsoft Web Platform Installer (WebPI) for installation and does not include installing PHP from source. Stay with us.

Introduction to php

PHP is a web scripting language that is very popular among developers due to its high speed, power and security. About 60% of all websites on the Internet are made by PHP. PHP is so powerful that popular websites like facebook, yahoo, wikipedia, apple, and popular and powerful content management systems like joomla, wordpress, drupal or forums like vbulletin were created and developed by php.

PHP stands for PHP Hypertext Preprocessor. PHP is an open source language and a server-side scripting language. PHP always stays free.

The structure of PHP is quite similar to the C programming language and it is very easy to learn. With PHP you can easily static pages, open files on the server, read, modify or delete , Connect to a variety of databases and save, retrieve and edit data, and you can also send and receive cookies. There are currently three versions of PHP, 5.6, 7.0 and 7.1, and versions 5.3, 5.4, 5.5 have expired and are no longer supported.

Recommended Article: How to upgrade Windows Server 2012 to 2016

How to install PHP on Windows Server

php is a free open source language that runs on the server side and returns the result in html. Of course, php requires running on linux servers, and to run on operating systems such as Windows, you must create a virtual linux server in Windows. In the continuation of the topic of php installation training, we will explain the working method, join us in the continuation of the topics with php language installation training. In this post, we will teach you how to install php 7 on a Windows server. Note that this requires a complete iis installation and must be enabled.

To start the installation, you must first go to the official site of microsoft web platform and download the program:


official site of microsoft web platform


PHP 7 installation steps in Windows Server

PHP is one of the most widely used server-side programming languages. Many popular CMSs and frameworks such as WordPress, Magento and Laravel are built in PHP. In this tutorial, we will explain how to install PHP on a Windows server.

After downloading, run the program and go to the products section:


products section in web platform installer


Then in this window from the left you have to go to the frameworks section.

There you have to find the php version you want (you have to make sure the selected version is equal to the Windows architecture.)

Then click on add and finally on install.


products section in web platform installer


Note: Above is x64 for 64-bit windows and x86 for 32-bit windows.

Next, in the new window, select the I Accept option.


how to install php on windows server


At this stage, you have to wait for the installation to be done and finally select the finish option.

You have now successfully installed.

How to test php installation on windows server

Next we have to test the program once:

You must first go to drive c. Then go to the inetpub directory and then to wwwroot.

Here you need to create a file called phpinfo.php and put the following code in it:

<?php phpinfo(); ?>


How to test php installation on windows server


Next you need to open your browser and go to the following address:


By going to this address, you should see a page similar to the one below. This means that php is installed and working well.


How to test php installation on windows server


Frequently Asked Questions

1. How to install PHP 7.4 with Apache?

If you are using Apache as your web server, run the following commands to install the PHP and Apache PHP modules:

sudo apt update sudo apt install php libapache2-mod-php
After installing the packages, restart Apache to load the PHP module:
sudo systemctl restart apache2

2. How to install PHP 7.4 with Nginx?

Run the following commands to install PHP and PHP FPM packages:

sudo apt update sudo apt install php-fpm
Once the installation is complete, the FPM service will start automatically. To check the status of the service, run the following commands:
systemctl status php7.4-fpm

php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-06-09 19:07:05 UTC; 37s ago

You can now edit the Nginx server block and add the following lines so that Nginx can process PHP files:

server {      # . . . other code      location ~ \.php$ {         include snippets/fastcgi-php.conf;         fastcgi_pass unix:q;     } }

Don’t forget to restart the Nginx service to get the new configuration up and running:

sudo systemctl restart nginx

3. What programs should be installed on the computer to start PHP programming?

Three things must be installed on your computer:

Web Server: PHP can run on most virtual web servers, including Microsoft IIS. But it is better to use the free Apache web server, which you can download from apache website.

Database: PHP can communicate with most databases, including Oracle and Sybase. But MySQL is commonly used, which you can download from mysql website.

PHP Parser: In order for PHP code to be processed and finally sent to the browser as HTML output, the PHP parser language must be installed.

Recommended Article: Tutorial add FTP Site on Windows Server 2019

4. What are PHP applications?

You can use PHP for 3 general purposes:

– Websites and web applications (server-side scripting)

– Desktop applications (GUI)

– Command line programming


In this article, first, an introduction to php was explained. Then we taught you how to install PHP on Windows Server. In the following, we explained how to test the correct installation of this program. Also, in the last section, we asked the frequently asked questions about installing php in different versions.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

    Leave Your Comment

    Your email address will not be published.

    We are by your side every step of the way

    Think about developing your online business; We will protect it compassionately

    We are by your side every step of the way


    7 days a week, 24 hours a day