How to install PHP on Windows using Winget
Winget, the Windows command-line tool to search, install, update, and remove Windows applications,now includes support for PHP. Using the CLIwinget tool, it is now possible to install PHP along with dependencies with a single command.
This article explains how tosearch,download,install,update, andremove Windows PHP binaries usingwinget. PHP packages are installed as portable applications that support modifying the system PATH variable, and require Winget to supportWinget manifest 1.9.0 or later.
Winget is installed by default on the latest Windows 11 and Windows Server 2025 versions. If Winget is now already installed, see theMicrosoft documentation on Winget.
Windows PHP binaries are sourced fromwindows.php.net. Winget package manifests include information about the latest versions, their SHA-256 checksums, and the download links forx64 andx86 systems. All of the downloads will beThread-Safe builds. At the moment,Arm64 builds are not available.
The PHP packages are installed asportable apps, supportingmultiple PHP versions simultaneously.
The PHP packages are in thePHP.PHP namespace, followed by the major and minor version numbers of the PHP release. For example,PHP 8.4 is available under the package IDPHP.PHP.8.4. Alternately, the same package is also available under thephp8.4 moniker, following the naming pattern used by Debian/Ubuntu PHP packages.
Search for PHP Packages on Winget
All Windows PHP builds are under thePHP.PHP namespace, and the full package ID is constructed by appending the PHP releases's major and minor version number to the namespace.
For example,PHP 8.4 is namedPHP.PHP.8.4.
To search for all PHP packages, run:
winget search PHP.PHP
This is comparable to runningapt search php ordnf search php on Linux distros such as Debian and RHEL or their derivatives.
To view information about a specific PHP package,winget show PHP.PHP.%VERSION%.
For example, to view information about PHP 8.4 Windows builds, runPHP.PHP.8.4:
winget show PHP.PHP.8.4
Alternately, it is also possible to runwinget show php8.4 for the same result.
Download PHP Windows Packages
winget allows downloading the ZIP files containing Windows PHP packages directly fromwindows.php.net. The download is verified against the SHA-256 checksum contained in the manifest to make sure it is not tampered with in transit.
To download the Windows PHP build for a given PHP version, runwinget download followed by the PHP version.
For example, to download PHP 8.4 to the current directory, run:
winget download php8.4 --skip-dependencies -d .
--skip-dependenciesskips downloading Microsoft Visual C++ package that PHP depends on.-d .specifies the download directory, and in this case, sets to the current working directory.
It downloads Thread-Safe builds of PHP for the CPU architecture the command is run on.
Downloading a packagedoes not modify anything else on the system. The difference betweendownload andinstall commands is that theinstall command not only downloads the package, but also registers it as an installed package with support for updates and removal.
Install a PHP Version
While thewinget download command only downloads a given PHP version, thewinget install command downloads a Windows PHP build, verifies it, extracts it, and updates system PATH variable to makephp available to run from the command line.
winget install PHP.PHP.8.4
It is possible to install multiple PHP versions simultaneously. Note that when installing a new PHP version, it can override the
phpexecutable path to the PHP version installed last.
In addition to thephp executable, the Winget packages also add aliases with the PHP version as a suffix. For example, PHP 8.4 can be directly executed by runningphp84. However, support for multiple aliases is a work in progress, tracked atmicrosoft/winget-cli#2884.
Update PHP Packages
When a new patch version of an already-installed PHP version is available,winget update shows it.
Runwinget update PHP.PHP.%version% to update to the latest patch version for that release. For example, to update PHP 8.4 to the latest version, run:
winget update PHP.PHP.8.4Remove an existing PHP Package
To remove a PHP version installed usingwinget, navigate to system Settings > Apps > Installed Apps, locate the PHP version, and click "Uninstall" under it.



