Advance

Installing PHP on Windows Server

Installing PHP on Windows Server
0
(0)

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 worrying 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 the source. Stay with us.

Tutorial Install PHP on Windows Server

Recommended Article: How to upgrade Windows Server 2012 to 2016

Introduction to PHP

PHP is a web scripting language popular among developers due to its high speed, power, and security. About 60% of all websites on the Internet are made with PHP. PHP is so powerful that popular websites like Facebook, Yahoo, Wikipedia, apple, and popular and powerful content management systems like Joomla, WordPress, and Drupal, or forums like Vbulletin were created and developed by PHP.

PHP stands for PHP Hypertext Preprocessor. It should be noted that 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.

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 you should enable it.

How to Install PHP on 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 section, we will explain how to install PHP on a Windows server using Windows Installer. To start the installation, you must first go to the official site of the Microsoft web platform and download the program:

 

official site of microsoft web platform

 

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.

You have to find the PHP version you want (you have to ensure 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 to complete the installation and finally select the finish option.

You have now successfully installed it.

How to test PHP Installation on a 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:

http://localhost/phpinfo.php

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, add the following commands to apache’s httpd.conf file to install the PHP and Apache PHP modules:

LoadModule php_module "C:\PHP\php8apache2_4.dll"   AddHandler application/x-httpd-php .php
Save the file and start the Apache. Then create a pinfo.php file in apache’s htdocs and once created go to the following URL:
http://127.0.0.1/pinfo.php

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?

You should install three things 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 the apache website.

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

PHP Parser: In order for PHP code to be processed and finally sent to the browser as HTML output, you should install 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

Conclusion

In this article, first, we explained an introduction to PHP. 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.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

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

    +8595670151

    7 days a week, 24 hours a day