How To Install PHP 8 on Windows 10
In this tutorial we will see how to install PHP 8 on Windows 10. However, PHP is and acronym for Hypertext Preprocessor. Moreover, it is the most popular, open source and cross platform server side scripting language. Additionally, PHP is supported on all the major operating systems like Windows, Linux and MacOS. Moreover, it is mostly used in web development because it can be embedded into HTML code. Also, the PHP code is enclosed between <?php and ?> Tags. However, PHP is easy, therefore it can be learnt quickly in no time. In addition to above it also supports all the major Web Servers. For example some of the most popular Web Server that support PHP are, Apache web Server, IIS Web Server, Nginx Web Server to name a few.
Although PHP is mostly used in combination with Mariadb Database Servers or MySQL Database Servers. But one of the most powerful features of PHP is that it supports almost all the major database servers. For example some of the most popular database servers are SYBASE, IBM-DB2, Oracle, MSSQL, PostgreSQL, to name a few. Therefore creating a dynamic webpages is very easy by using any of the supported database connection.
Prerequisite For Installation of PHP 8 on Windows 10 OS
Following are the requirement for the installation of PHP 8 on Windows 10 Operating System.
- First we will need a Desktop or laptop Computer with pre-installed Windows 10 Operating System. If you want to clean install Windows 10 Operating System on your new computer, you can visit our tutorial on how to install Windows 10. The link to the tutorial is Given below:
How to Install Windows 10 - Now we will need a Web Server preinstalled and configured on Windows 10 Operating System. Here we can use WAMP Server, XAMPP Server or we can also use the native Web Server of Windows 10, the IIS Web Server. Here we will be using the IIS Web Server for testing of our PHP installation. If you want to learn how to install WAMP Server on Windows 10, then you can follow our tutorial. The link to the tutorial is given below:
How to Install WAMP Server on Windows 10 - To create a full development environment, we will also require a pre-installed Database Server on our Windows 10 System. For this we can install MariaDB or MySQL Database Server on our System. Also, we have a tutorial for how to install MySQL Database Server on Windows 10. To follow our tutorial please go to the given below link to the tutorial:
How to Install MySQL 8 on Windows 10 - Finally we will require a stable and fast internet connection to download and install PHP 8 from its Official Website.
Now, we will see how to install PHP 8 on Windows 10 step by step with no steps skipped.
Installation Steps
Download PHP
Next, to install PHP 8 on Windows 10 visit the official website of PHP and download 64 bit Non-Thread-Safe version of the Installer zip file on your system. A link to the zip file is given below. Also the download page will look like the below screen.
How To Install PHP 8 on Windows 10
Link to Official Website of PHP 8 for Installer File Download |
However, we will also need Visual C++ redistributable 2015 and 2019 to be installed on our Windows 10 system, before the installation of PHP 8. For this download the Visual C++ redistributable for Visual Studio 2015 or 2016 and 2019, 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
PHP 8 Installation Steps on Windows 10
- The first step is to install C++ redistributable for Visual Studio 2015 or 2016 and 2019 o our system. download and install these files from the link given above.
- Now download the PHP 8 installer zip file on your system.
- Extract the zip file on your system.
- Rename the extracted folder to PHP8.
- Then move the renamed PHP8 folder to the root drive C:\ of the system.
- Now to set the path of the PHP 8 in the windows 10 system, Navigate to “Advanced System Settings”->“Environment Variables”->“System Variables”. Now select the path variable and select “add new”. In the “add new” window give the path to the PHP8 folder, “C:\PHP8” as shown in the figure then save and exit.
How To Install PHP 8 on Windows 10
Configure PHP
However, now you have to configure the PHP so that it can work correctly on your system. There will be two files in the C:\PHP8 folders php.ini-development and php.ini-production. Next, rename the file php.ini-development to php.ini and open in a text editor. Also, change the following settings in the php.ini file.
- Increase memory_limit from 128M to 512MB
- Uncomment the lines by removing ‘;’ for example the ;extionsion_dir = “ext” should become extionsion_dir = “ext”.
- Similarly uncomment the following lines by removing ‘;’ at 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
Check Installation
Now to check PHP installation open the command prompt and type.
php –v
You will see the output as given below.
How To Install PHP 8 on Windows 10
Now the PHP is installed on your system correctly.
Configure Internet Information Services (IIS)
If you want to run your PHP websites on Internet Information Services (IIS) Webserver then you have to configure FastCGI Module in IIS webserver. To do this perform the following steps.
- Go to settings->programs & features->Turn Windows features on or off
- Then navigate to Internet information services->World Wide Web Services->Application Development Features and check mark CGI and save and exit.How To Install PHP 8 on Windows 10
- To open IIS Webserver navigate to Control Panel=>Administrative Tools=>Internet Information Services. The default site and on the right hand side window click on Handler Modules.
- Then at the right most window there is a link add module, click on this link. A windows will be opened as shown in the figure below add FastCGI module as shown in the figure.
How To Install PHP 8 on Windows 10
Create a file phpinfo.php in any text editor. Type the following lines in it and save and exit.
<?php
phpinfo();
?>
Copy this file in the C:\Inetpub\wwwroot folder.
Open your browser and type :
http://localhost/phpinfo.php
You will see the output as given below.
How To Install PHP 8 on Windows 10
Now we have installed and tested PHP 8 successfully on our Windows 10 system. Enjoy!
Thanks !!! Good Article. Very helpful.