In this article we will learn how to install PHP 7.4 on Windows 10 step by step. Additionally, we will also learn configuration of PHP 7.4 on Windows 10 operating system. Currently the latest version of PHP 7.4 available on the official website is PHP 7.4.27. However PHP is an abbreviation for Hypertext Preprocessor. Off course, PHP is one of the most widely used server side scripting language. Moreover, PHP is an open source, free and cross platform server side scripting language.
Supported Operating Systems
Additionally, PHP can be used for programming on all popular operating systems such as Windows, Linux and MacOS. However, PHP is widely used in web development programming. The best thing is that, the PHP scripts can be embedded into HTML code. Additionally, the PHP script is always enclosed between <?php and ?> html tags. In addition to above, PHP is an easy to learn server side scripting language. This is the reason why PHP is so popular among the web developers. However, PHP also supports all the major web servers. The example of some of the most widely used web servers that supports PHP are; Apache web server, IIS web server, and Nginx web server etc.
Supported Database Servers
Moreover, PHP is widely used with Mariadb and MySQL Database Servers. In addition to above features one of the most significant features of PHP is that it supports almost all the most popular database servers. The examples of some of the most widely used database servers that are supported by PHP are SYBASE, IBM-DB2, Oracle, Microsoft SQL Server and PostgreSQL etc. This is the reason why developing a dynamic webpage becomes the easiest task by using any of the above supported database connection.
Prerequisites for Installation of PHP 7.4 on Windows 10 Operating System
Following are the requirement for the installation of PHP 7.4 on Windows 10 Operating System.
A. Operating System Requirement
- Firstly we will require a Desktop or laptop Computer with pre-installed Windows 10 Operating System. If you want to fresh install Windows 10 Operating System on your new laptop or desktop computer, you can visit our tutorial on “How to Install Windows 10 OS on Your PC”. The link to the tutorial is given below:
|How to Install Windows 10 OS on Your PC|
B. Web Server Requirement
- Additionally you will also require a preinstalled and properly configured web server on Windows 10 Operating System.
- Moreover, we can use WAMP Server, XAMPP Server or we can also use the native web server of Windows 10 OS, which is the IIS web server.
- In this tutorial we will be using the IIS web server for installation and testing of our PHP installation.
- If you want to learn how to install WAMP Server on Windows 10, then you can follow our tutorial “How to Install WAMP Server on Windows 10”. The link to the tutorial is given below:
|How to Install WAMP Server on Windows 10|
- Additionally, if you want to learn how to install XAMPP Server on Windows 10, then you can follow our tutorial “Install and Configure XAMPP Server on Windows 10”. The link to the tutorial is given below:
|Install and Configure XAMPP Server on Windows 10|
C. Database Server Requirement
- To build a complete web development environment, we will also need a pre-installed Database Server on our Windows 10 Operating System. To achieve this we can install MariaDB or MySQL Database Server on our computer.
- If you want to learn how to install MySQL Database Server on Windows 10 Operating System, then you can follow our tutorial on “How to Install MySQL 8.0 on Windows 10”. The link to the tutorial is given below:
|How to Install MySQL 8.0 on Windows 10|
- If you want to learn how to install MariaDB Database Servers on Windows 10 Operating System, then you can follow our tutorial “How to Install MariaDB 10 on Windows with Screenshots”. The links to the tutorial is given below:
|How to Install MariaDB 10 on Windows 10 with Screenshots|
- We will be using MySQL 8.23 Database Server for building the complete development environment in this tutorial.
- Finally we will need a stable and fast internet connection to download and install web servers, MySQL / MariaDB Database Server and PHP 7.4 from the Official Websites of each product.
Finally, now the prerequisites are complete and now we will learn how to install PHP 7.4 on Windows 10 Operating System step by step with no steps skipped.
Installation Steps for PHP 7.4 on Windows Operating System
Step-1. Download PHP 7.4 from the Official Website
In the first step, to install PHP 7.4 on Windows 10 Operating System, open your favorite web browser and navigate the official website of PHP.
Next, download the 64 bit Non-Thread-Safe version of the PHP7 Installer zip file on your system. At the time of writing this article the version of the PHP is 7.4.27 and the size of the zip file is 24.86 MB. The link to the PHP7 installer zip file is given below.
|The Link to the PHP7 Installer Zip File|
The download page of the official website of PHP will look like the below screen.
Step-2. Download Visual C++ redistributables from Official Website of Microsoft
However, in the second step, we will require Visual C++ redistributables 2015 and 2019 to be installed on our Windows 10 system, before the installation of PHP 7. For this download the Visual C++ redistributable for Visual Studio 2015 or 2016 and 2019 from the official website of Microsoft Windows, on your computer. A link to the download location on Official Microsoft Windows website is given in the left sidebar of the official PHP download page. The same download links are also provided below. Visual C++ Redistributable for Visual Studio 2015 Microsoft Visual C++ Redistributable for Visual Studio 2019
Step-3. PHP 7.4 Installation Steps on Windows 10 Operating System
- The first step is to install C++ redistributable for Visual Studio 2015 or 2016 and 2019 on your system. For this download and install these files from the links to the official website of Microsoft that are given above.
- Next download the PHP 7.4 installer zip file on your system from the link to the official website of PHP provided above.
- Now, using your favorite compression / decompression tool extract the downloaded zip file on your system. We are using the most popular and open source 7-Zip software for the purpose.
- Next, you have to rename the extracted folder from the zip file to “PHP7”.
- The next step is to move the renamed “PHP7” folder to the root directory of drive C:\ of your computer system.
- Now to set the path of the “PHP7” directory in the windows 10 operating system. Navigate to “Advanced System Settings”->“Environment Variables”->“System Variables”. Below given figure shows the windows.7. Next select the path variable and click on “add new” button.In the “add new” window give 8. the directory path of the “PHP7” folder, “C:\PHP7” as shown in the figure then click on the save button and exit.
Step-4. Configure PHP7 in Windows 10 Operating System
However, you have to configure PHP7 so that it can work correctly on your computer system. There are two files in the “C:\PHP7” Directory, php.ini-development and php.ini-production.
To create PHP development environment on your computer, rename the file php.ini-development to php.ini. Then open the file in your favorite text editor. We are using free and open source Notepad++ editor for the purpose.
Now carefully change the following settings in the php.ini file as described below.
- Navigate to the “increase memory_limit” line in the file and change the value from 128M to 512MB.
- The next step is to uncomment the following lines by removing ‘;’ before the lines. For example the “;extionsion_dir=ext” should become “extionsion_dir = ext”.
- Similarly uncomment the following lines by removing ‘;’ from the beginning of the line.
extension=bz2 extension=curl extension=ffi extension=fileinfo extension=gd2 extension=gettext extension=gmp extension=intl extension=mbstring extension=exif extension=mysqli extension=odbc extension=openssl extension=pdo_mysql extension=pdo_odbc extension=pdo_sqlite
Step-5. Check PHP7 Installation on Your Computer
Now to check “PHP7” installation on your computer, open the command prompt and issue the following command.
You will see the output as given below.
If the output is same as given above the PHP7 is correctly installed and configured on your system.
Step-6. Configure Internet Information Services (IIS) Web Server
If you want to run your PHP websites on Internet Information Services (IIS) web server then you have to configure FastCGI Module in IIS web server. To do this, perform the following steps.
Navigate to settings->programs & features->Turn Windows features on or off.
Then navigate toInternet information services->World Wide Web Services->Application Development Features and check mark CGI and save and exit as shown in the below given figure.
To open IIS web server, navigate to Control Panel=>Administrative Tools=>Internet Information Services. The default site and on the right hand side window click on Handler Modules.
Then in the window in the right side, there is a link add module. Now click on the add module link. A new window will open as shown in the figure below. Next add FastCGImodule as shown in the figure.
Step-7. Verify the PHP7 Installation on Your Computer System
Create a file phpinfo.php in your favorite text editor. Type the following lines in the newly created file and save and exit.
Copy this file in the C:\Inetpub\wwwroot folder. Open your browser and type:
You will see the output as given below.
Now we have installed and tested PHP 7.4 successfully on our Windows 10 system. Enjoy!