DEV Community

Amulya
Amulya

Posted on • Updated on

How to Download & Install PHP 8 on Windows 10

This post will help you download & install php 8 on Windows 10 and set php 8 to system's path, verify php version and run the php 8 local development server.

Download & Install PHP 8

  • Head to php.net
  • Click Download button
  • Click Windows Downloads
  • Download Thread safe 32/64 bit zip package for your system type
  • Extract the zip package
  • Paste the extracted folder onto your desired drive (C?D?E?)
  • Rename this folder to php8
  • One this folder and look for php.ini-development file
  • Make a copy of this file and rename copy version to php.ini
  • Open php.ini file with your preferred text editor and uncomment PHPIniDir “ext”
  • Save the file and close the editor.

Learn PHP & MySQL

LEARN PHP and MySQL from Highly Rated Experts one-to-one $5 an hour.

Set PHP 8 to System's Path

  • Open php8 folder and copy and folder path
  • Press Windows Key on your keyboard and type 'variable' and hit Enter
  • Click Environment Variables
  • Click Edit and Click NEW on the right
  • Paste the php8 folder path
  • Click OK, OK, OK

Verify PHP Version

  • Launch Command Prompt
  • Type php -v

Run PHP Local Development Server

  • Create a Folder on your desktop
  • Open this folder with your text editor
  • Create a file and save as filename.php
  • Write PHP code and save it
  • <?php echo phpinfo(); ?>
  • Navigate your CMD to this folder
  • Run PHP server
  • php -S 127.0.0.1:3000
  • Launch Browser
  • Navigate to 127.0.0.1:3000/filename.php

Install PHP 8 on Windows 10

Top comments (2)

Collapse
 
dmikester1 profile image
Mike Dodge

This part is confusing:
Click Environment Variables
Click Edit and Click NEW on the right

I am assuming I am editing the Path variable under System variables in that section.

Collapse
 
dmikester1 profile image
Mike Dodge

Also, after setting the Path, on my machine at least, I needed to reboot before CMD would recognize the PHP command.