Ubuntu 26.04 225 LTS ships PHP 8.5 in its main archive. Packages carry the version in their names, and each extension is a package of its own:
sudo apt install php8.5-cli php8.5-fpm php8.5-mysql php8.5-mbstring \
php8.5-xml php8.5-curl php8.5-intl php8.5-zip
php -vphp8.5-cli is already the newest version (8.5.4-0ubuntu1.3).
php8.5-fpm is already the newest version (8.5.4-0ubuntu1.3).
...
PHP 8.5.4 (cli) (built: Sep 2 2026 14:42:18) (NTS)
Copyright (c) The PHP Group
Built by Ubuntu
Zend Engine v4.5.4, Copyright (c) Zend Technologies
with Zend OPcache v8.5.4, Copyright (c), by Zend TechnologiesUbuntu freezes the upstream point release (8.5.4) and backports security fixes into it, so the number lags php.net's 8.5.10 without leaving you unpatched. Install libapache2-mod-php8.5 instead of php8.5-fpm only if you want mod_php. Ubuntu 24.04 ships PHP 8.3; on 24.04 and 22.04, get 8.5 from Ondřej Surý's PPA (sudo add-apt-repository ppa:ondrej/php), which for 26.04 points to packages.sury.org instead.
On Windows, the simplest route is WSL2 6 with the Ubuntu steps above, which gives you the same stack as the server (LAMP Inside WSL2). WampServer 861,070 bundles the whole stack (WampServer). For native PHP, winget 26,463 install PHP.PHP.8.5 fetches php.net's thread-safe x64 build (winget show listed 8.5.10, from php-8.5.10-Win32-vs17-x64.zip); the non-thread-safe package PHP.PHP.NTS.8.5 lagged at 8.5.8 the same day, so check php -v after any install. By hand, unzip php.net's x64 build (NTS for the CLI and IIS 25,490 , TS for Apache 129 ) to C:\php, add it to PATH, install the Visual C++ 2015-2022 redistributable and copy php.ini-development to php.ini.