Skip to Content

PHP

A popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

Table of Contents

Installation

Easiest and simplest way to install PHP on Windows is to use package managers like Chocolatey or Scoop.

Note

For Laragon users, PHP is already available. Just launch Laragon > Terminal and type php -v to check the version.

Option 1: Using choco

Step 1: Open your Terminal as Administrator

  • Press Windows Key + X and select Windows PowerShell (Admin) or Command Prompt (Admin).
  • Click Yes if prompted by the User Account Control dialog.

Step 2 Install PHP using command:

powershell
choco install php -y --version=8.3.11
Note

The -y flag automatically accepts all prompts, making the installation seamless. By passing --version flag, we are explicitly installing PHP version 8.3.11 (which is the latest version at the time of writing this article). You can omit this flag to always install the latest version.

Option 2: Using scoop

Step 1: Open your Terminal

  • You don’t need to run Terminal as an administrator for Scoop.

Step 2: Install PHP using command:

powershell
scoop bucket add main scoop install main/php

You can also install specific version of PHP using the following command:

powershell
scoop bucket add versions scoop install versions/php83

Option 3: Using Homebrew

Step 1: Open your Terminal.

Step 2: Install PHP using command:

powershell
brew install php
Note

By default, this will install latest version. You can also specify version by using brew install [email protected].

Notes

  • Chocolatey and Scoop will manage the PHP installation path, so you don’t need to adjust your system’s PATH variable manually.

  • You can update PHP in the future with a single command:

    • Chocolatey: choco upgrade php
    • Scoop: scoop update php
    • Homebrew: brew upgrade php
Last updated on