PHP 8.2.21 is an old release of PHP 8.2 series. Using the latest version PHP 8.2.23 is highly recommended.
PHP 8.2 continues to receive bug fixes and security fixes until 2024-12-31.
Downloads
Source Code
Git Clone
Use Git to clone the 8.2.21 tag from the PHP Git repository.
git clone https://github.com/php/php-src.git --depth 1 --branch php-8.2.21
How to compile PHP
PHP can be compiled by setting up the dependencies, building the configure script (
Detailed articles on how to compile PHP are available for Ubuntu/Debian based systems and Fedora/RHEL based systems.
./buildconf
), configuring the build ./configure
, and running make
.Detailed articles on how to compile PHP are available for Ubuntu/Debian based systems and Fedora/RHEL based systems.
Windows binaries
Non-Thread Safe Builds
Non-Thread Safe (NTS) builds are single-threaded PHP builds. They can be used on web servers that integrate PHP over FastCGI protocol, such as Nginx, Caddy, and IIS.
php-8.2.21-x64NTS.zip (30.31 MiB)
php-8.2.21-x86NTS.zip (27.2 MiB)
Thread-Safe Builds
Thread-Safe (TS) builds are multi-thread PHP builds, often used to integrate PHP as a Server API for multithreaded servers. The most common use case is using PHP as an Apache module.
php-8.2.21-x64TS.zip (30.42 MiB)
php-8.2.21-x86TS.zip (27.19 MiB)
Docker/Podman Containers
PHP CLI
PHP CLI Containers images only include the PHP CLI, and no FPM or Apache modules. The Alpine builds are lightweight, but may introduce incompatibilities due to their musl builds. Albeit their larger size, the Debian-based (without the "-alpine" suffix) images are more complete, and widely used.
Alpine-based: Lightweight, but may introduce incompatibilities due to their musl builds.
docker pull php:8.2.21-cli-alpine
Debian-based: More compatible with other components, complete, and are widely used.
docker pull php:8.2.21-cli
PHP CLI + Web Server Integration
These container images include PHP CLI, and a web server integration. FPM container images can be integrated with web servers such as Nginx, Caddy, and Apache with Event MPM. The Apache container images include Apache web server, integrating PHP as an Apache module.
Alpine-based: Lightweight, but may introduce incompatibilities due to their musl builds.
docker pull php:8.2.21-fpm-alpine
Debian-based ZTS Apache: Includes Apache web server integrating PHP as an Apache module.
docker pull php:8.2.21-apache
Debian-based NTS FPM: PHP-FPM, can be integrated with Nginx, Caddy, and other web servers over Fast CGI.
docker pull php:8.2.21-fpm
ChangeLog
Core
- Fixed bug GH-14315 (Incompatible pointer type warnings).
- Fixed bug GH-12814 (max_execution_time reached too early on MacOS 14 when running on Apple Silicon).
- Fixed bug GH-14387 (Crash when stack walking in destructor of yielded from values during Generator->throw()).
- Fixed bug GH-14456 (Attempting to initialize class with private constructor calls destructor).
- Fixed bug GH-14549 (Incompatible function pointer type for fclose).
BCMath
- Fixed bug (
bcpowmod()
with mod = -1 returns 1 when it must be 0).
Curl
- Fixed bug GH-14307 (Test curl_basic_024 fails with curl 8.8.0).
DOM
- Fixed bug GH-14343 (Memory leak in xml and dom).
FPM
- Fixed bug GH-14037 (PHP-FPM ping.path and ping.response config vars are ignored in status pool).
GD
- Fix parameter numbers for imagecolorset().
Intl
- Fix reference handling in SpoofChecker.
MySQLnd
- Partially fix bug GH-10599 (Apache crash on Windows when using a self-referencing anonymous function inside a class with an active mysqli connection).
Opcache
- Fixed bug GH-14267 (opcache.jit=off does not allow enabling JIT at runtime).
- Fixed TLS access in JIT on FreeBSD/amd64.
- Fixed bug GH-11188 (Error when building TSRM in ARM64).
PDO ODBC
- Fixed bug GH-14367 (incompatible SDWORD type with iODBC).
PHPDBG
- Fixed bug GH-13681 (segfault on watchpoint addition failure).
Soap
- Fixed bug #47925 (PHPClient can't decompress response).
- Fix missing error restore code.
- Fix memory leak if calling
SoapServer::setObject()
twice. - Fix memory leak if calling
SoapServer::setClass()
twice. - Fix reading zlib ini settings in ext-soap.
- Fix memory leaks with string function name lookups.
- Fixed bug #69280 (SoapClient classmap doesn't support fully qualified class name).
- Fixed bug #76232 (SoapClient Cookie Header Semicolon).
- Fixed memory leaks when calling SoapFault::__construct() twice.
Sodium
- Fix memory leaks in
ext/sodium
on failure of some functions.
SPL
- Fixed bug GH-14290 (Member access within null pointer in extension spl).
Standard
- Fixed bug GH-14483 (Fixed off-by-one error in checking length of abstract namespace Unix sockets).
Streams
- Fixed bug GH-11078 (PHP Fatal error triggers pointer being freed was not allocated and malloc: double free for ptr errors).
Commit List
Arnaud Le Blanc
- Fix TLS access in JIT on FreeBSD/amd64 in 79862f24da
Ben Ramsey
- Update NEWS in 557e09f678
Bob Weinand
- Fix GH-14387: Crash when stack walking in destructor of yielded from values during Generator->throw() in be7f3aa474
Calvin Buckley
- Remove use of SDWORD and SWORD in ODBC extensions (GH-14457) in c15f5a2a6f
David Carlier
- Fix GH-12104 attempt in 19cb9c7b4a
- Fix GH-13681: segfault when adding watchpoint fails in 03f0776d08
Derick Rethans
- Fixed off-by-one error in checking length of abtract namespace Unix sockets in ad56ec7bbf
- Update NEWS in c595ab96ab
Dmitry Stogov
- Fix incorrect conditions in 48ae025c33
- Fix undefined behavior (left shift of negative number) in 9534e0d42d
- Fix GH-14480: Method visibility issue introduced in version 8.3.8 in GH-14484
- Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths in GH-14558
Gina Peter Banyard
ext/bcmath
: Fixed bug (bcpowmod()
with mod = -1 returns 1 when it must be 0) in 709869c8bdext/standard
: Fix test conflict with I/O tests in 75f6132818- Fix bug GH-14456: Attempting to initialize class with private constructor calls destructor in cdb7677b38
ext/soap
: Fix memory leaks when calling SoapFault::__construct() twice in df219ccf9d
Giovanni Giacobbi
- Fix parameter numbers for
imagecolorset()
in da769be7c9
Ilija Tovilo
- Fix enabling of JIT at runtime in 9506ca6001
- Skip JIT test if php is compiled without jit in 04c9749e35
- Re-add 32-bit push build in 69dbfadd1e
- Attempt to fix mysql_native_password error for 32-bit build in a05301e783
- Fix windows rename test directories clashing in 8d9f9755e8
- Remove GitHub actions junit artifacts in f598b58790
Jakub Zelenka
- Skip test for OpenSSL bug #74341 which is not a bug in 46013f1c55
Kévin Dunglas
- Set SG(rfc1867_uploaded_files) to null after destroy in c47d357db5
Manuel Kress
- Use ITIMER_REAL for timeout handling on MacOS / Apple Silicon system in 272da51bfd
nielsdos
- Fix GH-11188: Error when building TSRM in ARM64 in 644d3628e3
Niels Dossche
- Fix GH-14290: Member access within null pointer in extension spl in b3a56bd558
- Fix memory leaks in
ext/sodium
on failure of some functions in 4da46107c4 - Fix GH-14307: Test curl_basic_024 fails with curl 8.8.0 in a2c5b4ec05
- Fix bug #47925: PHPClient can't decompress response (transposed uncompress methods?) in 35e62e9b59
- Fix GH-14343: Memory leak in xml and dom in GH-14347
- Fix bug #47925 again in GH-14348
- Partially backport GH-13782 to stable branches in c815cdcfe7
- Fix GH-14368: Test failure in
ext/session/tests/gh13856.phpt
in GH-14378 - Fix missing error restore code in ext-soap in GH-14379
- Fix memory leak if calling
SoapServer::setObject()
twice in 51bb9c2c2a - Fix memory leak if calling
SoapServer::setClass()
twice in 23912f55eb - Fix reading zlib ini settings in ext-soap in 89c4db9c22
- Fix memory leaks with string function name lookups in 18233e0f2e
- Fix bug #69280: SoapClient classmap doesn't support fully qualified class name (#14398) in 476706165a
- Fix bug #76232: SoapClient Cookie Header Semicolon in 1b1677a8f1
- Fix reference handling in SpoofChecker in 5ec26edfb6
- Fix GHSA-9fcc-425m-g385: bypass CVE-2024-1874 in 4b15f5d4ec
- Fix GHSA-3qgc-jrrr-25jv in 9382673148
- Fix GHSA-w8qr-v226-r27w in 7e0e3cc820
- Fix GH-11078: PHP Fatal error triggers pointer being freed was not allocated and malloc: double free for ptr errors in bc558bf7a3
Peter Kokot
- Fix incompatible pointer type warnings in 9e226b2881
Ryan Carsten Schmidt
- Fix incompatible function pointer types in b43378d830
Sergey Panteleev
- Update versions for PHP 8.2.21 in 482ca6c19c
Valentin Udaltsov
- Fix
gen_stub.php
errors in GH-14335
Wilhansen Li
- Fix GH-14037: Make /ping of php-fpm work with pm.status_listen pool in 43bc53a730