How to install PHP on windows 10


Step 1 - - First download the Apache server from https://www.apachelounge.com/download/ (httpd-2.4.27-Win64-VC15.zip)

Unzip the folder, rename the folder and kept at C:\apache



Step 2 - Also download the php ‘php-7.1.8-Win32-VC14-x64’ from official site if your PC is 64 bit. http://windows.php.net/download/ Extract the folder and rename the folder as ‘php’ and past into ‘C:\apache’ as shown above.

Step 3 - Create the ‘temp’ folder ‘C:\apache’ folder. Also create the ‘session’ and ‘upload’ folder into ‘temp’ folder.

Step 4 - Also create the you project folder as ‘E:\My Websites’ folder.

Step 5 - Go to the ‘C:\apache\php’ and rename the file ‘php.ini-production’ file to ‘php.ini’.

Step 6 -Open the ‘php.ini’ and do these below changes
- Change to this line to as -> doc_root = "E:\My Websites"
- Change to this line to as -> extension_dir = "C:\apache\php\ext"
- Change to this line to as -> upload_tmp_dir = "C:\apache\temp\upload"
- Change to this line to as -> session.save_path = "C:\apache\temp\session"

Step 7 - Go to the folder ‘C:\apache\conf’ and open the ‘httpd.conf’ file.
- Change to this line to as -> DocumentRoot "E:/My Websites"
- Change to this line to as -> >Directory "E:/My Websites">
- Change to this line to as -> AllowOverride All
- Change to this line to as -> DirectoryIndex index.html index.php

Step 8 - At the end of the ‘httpd.conf’ file add these lines of code.
LoadModule php7_module "C:/apache/php/php7apache2_4.dll"
ScriptAlias /php/ "C:/apache/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "C:/apache/php"
PHPIniDir "C:/apache/php/"

Step 9 - Now install the apache Install Apache as a Windows service.
Open a command prompt, enter: go to
C:\>cd apache/bin
C:\>httpd -k install




Step 10 - Go to C:\apache\bin and start the ‘ApacheMonitor’ application.

Step 11 - Start the server.




Step 12 - Test the application http://localhost/Testphp.php.