APPX Software Library

Chapter 3: Install on Windows Server

Install the Current PHP CLI

Use the official PHP 8.5 x64 Non Thread Safe ZIP. The Win32 text in its filename is historical; the x64 suffix identifies the architecture. Use the matching Microsoft Visual C++ x64 runtime required by that PHP build.

  1. Open an elevated PowerShell window.
  2. Create C:\AppxTools\PHP85 and a download directory.
  3. Download PHP using the release metadata, verify its SHA-256 checksum, then extract it.
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
[Net.ServicePointManager]::SecurityProtocol = `
    [Net.SecurityProtocolType]::Tls12
$download = 'C:\AppxTools\Downloads'
New-Item $download -ItemType Directory -Force | Out-Null
$all = Invoke-RestMethod `
    'https://downloads.php.net/~windows/releases/releases.json'
$release = $all.'8.5'
$package = $release.'nts-vs17-x64'.zip
$archive = Join-Path $download $package.path
curl.exe -fLsS --max-time 240 `
    ('https://downloads.php.net/~windows/releases/' + $package.path) `
    -o $archive
if ($LASTEXITCODE -ne 0) { throw 'PHP download failed' }
if ((Get-FileHash $archive -Algorithm SHA256).Hash `
    -ne $package.sha256) { throw 'PHP checksum mismatch' }
Expand-Archive $archive 'C:\AppxTools\PHP85' -Force

The backtick continues a PowerShell command onto the next line. Keep it as the final character on that line, or enter the command on one line.

The baseline package is php-8.5.11-nts-Win32-vs17-x64.zip. Its published SHA-256 is 0ea96e0d2b9b737a6036f05cf4e95c49313faa6d0f27bd97edb2742503f0c043. The metadata procedure deliberately chooses the current PHP 8.5 maintenance package at installation time.