Release Information
- Release Type
- Security Update
- Release Status
- Latest
- Branch Status
- Supported (Latest)
Latest PHP release in the latest version. This release contains security fixes, and it is recommended to update as soon as possible.
PHP 8.5 continues to receive bug fixes and security fixes until 2027-12-31.
Downloads
Source Code
Git Clone
Use Git to clone the 8.5.9 tag from the PHP Git repository.
git clone https://github.com/php/php-src.git --depth 1 --branch php-8.5.9How 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.5.9-x64NTS.zip
Size: 34.35 MiB SHA256:
516c2d72231bd035c8a910120834add0ad208098b790b4909b2cbeb93ce135fc php-8.5.9-x86NTS.zip
Size: 30.83 MiB SHA256:
702494c2b573aff8ab364d667a9c8897dd96a498a78aacbd33442bcf19b1e7dc 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.5.9-x64TS.zip
Size: 34.48 MiB SHA256:
6a8af9f5d2a35b81cd9f1db04bd4037c3609828db62f81589e29e13faffd45f9 php-8.5.9-x86TS.zip
Size: 30.88 MiB SHA256:
a87b6475fbbdd6c12c74cfb3c8095032f324d6813604cbbbb236cac3f5bc4171 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.5.9-cli-alpineDebian-based: More compatible with other components, complete, and are widely used.
docker pull php:8.5.9-cliPHP 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.5.9-fpm-alpineDebian-based ZTS Apache: Includes Apache web server integrating PHP as an Apache module.
docker pull php:8.5.9-apacheDebian-based NTS FPM: PHP-FPM, can be integrated with Nginx, Caddy, and other web servers over Fast CGI.
docker pull php:8.5.9-fpmChangeLog
Core
- Fixed bug GH-22290 (AST pretty printing does not correctly handle strings containing NUL).
- Fixed bug GH-22206 (missing return in global register detection).
- Lock unmodified readonly properties for modification after clone-with.
BCMath
- Fixed GHSA-x692-q9x7-8c3f (Out-of-bounds write in
bccomp()). (CVE-2026-17544)
Calendar
- Fixed bug GH-22602 (
gregoriantojd()andjuliantojd()integer overflow with INT_MAX year).
Date
- Update timelib to 2022.17.
- Fixed bug GH-19803 (Parsing a string with a single white space does create an error).
- Fixed Unix timestamps in February of the year 0 are misparsed with @-notation.
- Fixed bug GH-11310 (
__debugInfodoes nothing on userland classes extending Date classes).
DBA
- Fixed OOB read on malformed length field in dba flatfile handler.
DOM
- Fixed bug GH-22570 (Stack overflow when serializing a deeply nested Dom\XMLDocument).
- Fixed getElementsByClassName()
item()returning the wrong element on random access.
Exif
- Fixed bug GH-11020 (
exif_read_data()emits a spurious "Illegal IFD size" warning when an IFD is not followed by a next-IFD offset).
GD
- Upgrade libgd. (CVE-2026-9672)
Hash
- Fixed bug GH-18173 (
ext/hashrelies on implementation-defined malloc alignment).
ODBC
- Fixed bug GH-22668 (Heap buffer over-read when a column value exceeds the driver-reported display size).
Opcache
- Fixed bug GH-22158 (Tracing JIT dispatches the observer begin handler through the wrong run_time_cache slot on megamorphic calls).
- Fixed bug GH-22443 (Tracing JIT SIGSEGV on megamorphic dynamic calls from an undereferenced run_time_cache map_ptr offset).
- Fixed bug GH-21770 (Infinite recursion in property hook getter in opcache preloaded trait).
OpenSSL
- Fixed timeout for supplemental read at end of a blocking stream in SSL stream wrapper.
Intl
- Fixed
Locale::lookup()andlocale_lookup()to return NULL instead of the fallback locale when a language tag cannot be canonicalized. - Fixed memory leaks when calling
Collator::__construct()orSpoofchecker::__construct()twice. - Fixed memory leak when calling
IntlListFormatter::__construct()twice. - Fixed IntlChar methods leaving stale global error state after successful calls.
PDO_ODBC
- Fixed bug GH-20726 (Crash with ODBC connection pooling when the DSN carries no credentials).
- Fixed bug GH-22667 (Heap buffer over-read when a column value exceeds the driver-reported display size).
- Fixed bug GH-22666 (Heap buffer overflow when an output parameter value is longer than the declared maxlen).
- Fixed bug GH-22665 (Out-of-bounds write when the ODBC driver reports a diagnostic message length beyond the error buffer).
PGSQL
- Fixed GHSA-7qpv-r5mr-78m4 (SQL injection via E'...' backslash breakout). (CVE-2026-17543)
Phar
- Fixed inconsistent handling of the magic ".phar" directory. Paths such as "/.phar" remain protected, while non-magic paths that merely start with ".phar" are handled consistently across file and directory creation, copying, ArrayAccess, stream lookup, directory iteration and extraction.
- Fixed GHSA-vc5h-9ppw-p5f3 (Crash via recursive symlinks). (CVE-2026-7260)
PHPDBG
- Fixed bug GH-17387 (Trivial crash in phpdbg lexer).
- Fixed fleaked lowercased lookup keys in phpdbg_resolve_opline_break.
- Fixed off-by-one in
phpdbg_safe_class_lookup()causing class lookups to always fail during phpdbg's signal-safe interruption path.
Reflection
- Fixed bug GH-22324 (Ignore leading namespace separator in
ReflectionParameter::__construct()). - Fixed bug GH-22441 (
ReflectionClass::hasProperty()and getProperty() ignore dynamic properties shadowing a private parent property). - Fixed bug GH-22658 (
ReflectionConstant::__toString()with a string value with null bytes truncates output). - Fixed bug GH-22683 (Reflection(Class)
Constant::__toString()should not warn on NAN conversions). - Fixed bug GH-22681 (Reflection*::__toString() truncates on null bytes).
Session
- Fixed bug GH-21314 (Different session garbage collector behavior between PHP 8.3 and PHP 8.5).
SPL
- Fix class_parents for classes with leading slash in non-autoload mode.
- Ignore leading back-slash in
class_parents(),class_implements(), andclass_uses(). - Fixed bug GH-16217 (
SplFileObject::fputcsv()on an uninitialized object segfaults).
Standard
- Fixed bug GH-22395 (
base_convert()outputs at most 64 characters). - Fixed bug GH-22678 (Use-after-free in
array_multisort()when the comparator mutates the array being sorted).
URI
- Fixed behavior of Uri\WhatWg\Url wither methods with regards to empty opaque hosts.
- Fixed bug GH-22628 (Percent-encoding of caret in WHATWG URL paths is not performed).
- Fixed bug GH-22629 (WHATWG Validation error incorrect with empty host and non-empty userinfo).
Zip
Commit List
alhudz
ext/dba: fix oob read on malformed length field in dba flatfile handler in a9c7dfefbd
arshidkv12
ext/calendar: Fix integer overflow in GregorianToSdn() and JulianToJd() in GH-22604ext/ldap: fixldap_explode_dnresult ordering in 7809f94b1f
Daniel Scherzer
- Update NEWS after cherry-pick in f53c8a48ca
- [8.5] NEWS: add entry for bugfix from GH-22187 in 76dad0667f
- Add regression tests for
ReflectionConstant::__toString()with null bytes in 5b00437a09 - GH-22658: avoid truncation on null bytes in
ReflectionConstant::__toString()in ed3e06a673 - NEWS in 834bdcedd1
- [8.5] NEWS: add entry for bugfix from GH-22659 in 955a2ce519
- Add regression tests for
Reflection*::__toString()with null bytes in 1db6c84050 - GH-22681: avoid truncation on null bytes in
Reflection*::__toString()in 8706cd43f6 - NEWS in 4804d17a13
- Add regression tests for
ReflectionEnum::__toString()with null bytes in 0fca39de81 - GH-22681: avoid truncation on null bytes in
ReflectionEnum::__toString()in 1b2c0abbdb
David Carlier
- Fix GH-22360: convert.base64-encode corruption on incremental flush in bd8a9bd3b1
ext/openssl:openssl_encrypt()zend mm heap overflow on AES-WRAP-PAD mode in cbc0489126ext/soap: backport GH-22586 fix in cf2f699a6dext/standard: getimagesize()/getimagesizefromstring()overflow in f08491bf08ext/dom: fix GH-22570 new test in 33d243c214ext/dom: getElementsByClassName()item()returns wrong element on random access in 7f97b83976- GH-22617: avoid null byte truncation of persistent stream keys in df773093ef
Derick Rethans
- Updated to version 2026.3 (2026c) in 29f8f56b1e
- Update timelib to 2022.17, which has fixes for PHP bugs in d83851dae8
- Fix GH-11310:
__debugInfodoes nothing on userland classes extending Date classes in GH-22655 - Fixed
__debugInfo()usage on PHP 8.5 and later for DatePeriod in GH-22677
Eyüp Can Akman
ext/exif: Fix GH-11020: spurious "Illegal IFD size" warning inexif_read_data()in 6317a472f4
Gina Peter Banyard
- NEWS entries for recent SPL bug fixes in 6a323eb7a4
Ilia Alshanetsky
- Remove stray
printf()on invalid DSN version in pdo_dblib in 8e3ab80667 - Fix buffer overflow converting @@IDENTITY in pdo_dblib lastInsertId in 1a5a81ca9f
zend_ast: Escape control bytes in exported string literals in f3cf2f4527- Fix leak of preserved input string with
FILTER_THROW_ON_FAILUREin 235b9b5cc1 - Fix MIME charset sniffing advancing by name length not value length in 98563c2d8e
- Fix heap over-read seeding the long-column buffer in pdo_odbc in 91ea928c9b
- Fix file descriptor leak when
proc_open()descriptor setup fails in 100938b40b ext/ftp: fix out-of-bounds read inftp_get()ASCII CRLF translation in 35fde02e42- Fix leak of resolved address list in
netsnmp_session_init()in 3704b9d3c9 - Fix
socket_sendmsg()sending wrong fd for Socket objects in SCM_RIGHTS in e463914fb2 - Fix SOAP client failing to follow a scheme-less redirect Location in de39a14cc7
- Fix GH-22158: JIT observer dispatch through wrong run_time_cache slot in 19f595fd9e
ext/gd: fix out-of-bounds write reading font header on short reads in df1250dc64ext/com_dotnet: release the held IUnknown incom_get_active_object()in ca4561cda6- Throw on below-minimum opslimit/memlimit in sodium pwhash in df7fd97212
ext/ftp: fix off-by-one terminator write inftp_readline()in 34a9a43904- pdo_pgsql: preserve the pending exception when a COPY row fails to convert in f0236f11ba
- Fix session save-handler argv leak on recursive rejection in 087a08d970
- Fix freeing uninitialized memory in LDAP sort control parsing in a15654ece0
- Fix posix_getpwnam()/
posix_getpwuid()crash on NULL passwd fields in 84d8342580 - Fix int32_t overflow in intl_charFromString() capacity calculation in 4d70d745ab
ext/gd: pack imageloadfont short-read test in native byte order in 5af56148a2- Fix invalid Firebird isolation level proceeding with the connection in 06037f8b7b
- Fix signed
dbconvert()return stored into size_t in dblib lastInsertId in c94681937f - Fix posix_getgrnam()/
posix_getgrgid()crash on NULL group name in be55be0a4d - soap: do not overwrite the parsed host on a protocol-relative redirect in 27c10ddce6
- Guard uninitialized SplFileObject in
fputcsv()andnext()in 60d8e92ed4 - Report dynamic property shadowing a private parent in Reflection in 86d78cc24f
- JIT: Fix run_time_cache offset stored without map_ptr dereference in a0ddc2aa57
- Fix int truncation of read length in
shmop_read()in 64cf7b2dba - Fix use-after-free in
Collator::sort()with a mutating comparator in 5fa74db18d - Fix use-after-free in RecursiveIteratorIterator on reentry in 1cbd3b9ba9
- Fix use-after-free in XPath php:function argument nodes in f9821dd1dd
- Fix use-after-free in RecursiveIteratorIterator on reentrant teardown in efbf47300b
- Fix GH-17387: crash on unterminated quote in phpdbg lexer in 2e564a747c
- Fix GH-18173:
ext/hashrelies on implementation-defined malloc alignment in 8da53b5d31 - Fix GH-20726: crash in pdo_odbc with pooling and no credentials in GH-22512
- Fix infinite recursion in property hook getter in opcache preloaded trait in d27da095b1
- Fix GH-22570: stack overflow serializing a deeply nested Dom\XMLDocument in dd57694402
- Fix GH-22678:
array_multisort()use-after-free on mutating comparator in 1e9f56cdb4 - Fix use-after-free on re-entrant
ftp_close()during a transfer in 1feb20156b - Install the SQLite ODBC driver in CI in c3236b922d
- Fix GH-22667: pdo_odbc heap over-read on oversized column value in 103c84ff4c
- Fix GH-22668: odbc heap over-read on oversized column value in 8e4daeff7a
- Fix GH-22666: pdo_odbc heap overflow on oversized output param in a7539ff834
- Fix GH-22665: pdo_odbc OOB write on oversized diagnostic length in 345b88deeb
Ilija Tovilo
- Merge Lexbor patch c3a68477 in 2587b82759
- Fixed timeout for supplemental read at end of a blocking stream in SSL stream wrapper in 1c196d0ee5
- Fix performance of
gh22443.phptin 21204bf59a - libgd patch for CVE-2026-9672 in 75f4e4cc3d
- Fix SQL injection in ext-pgsql via E'...' backslash breakout in 4b4baffc1f
- Revert "Fix GH-21986:
PharData::getContent()crash on infinite recursion with symlinks." in 5cb2a5ea28 - Add NEWS entries in 43d4b695fd
Jakub Zelenka
- Fix GHSA-vc5h-9ppw-p5f3: phar circular symlink crash in 4d7ff78850
Jarne Clauw
- Fixing memory leak in openssl_x509_parse when str_serial creation fails in GH-21751
- Fixing memory leak in openssl_pkcs12_read when zout initialisation fails in GH-21752
- Fixing memory leak in php_openssl_x509_fingerprint when getting mdtype with
php_openssl_get_evp_md_by_namein GH-21965 - Fixing memory leak in zif_openssl_seal and zif_openssl_open when fetching cipher with
php_openssl_get_evp_cipher_by_namein GH-21967
Jorg Adam Sowa
ext/spl: fix class_parents for classes with leading slash in non-autoload mode in GH-22283ext/spl: ignore leading namespace separator inspl_autoload()in GH-22323- phpdbg: Fix off-by-one in
phpdbg_safe_class_lookup()signal-safe class lookup in GH-22593 - CI: Revert timeout fix for Symfony community build in GH-22682
Jorg Sowa
- Ignore leading namespace separator in
ReflectionParameter::__construct()in 47f060ca33 - ci: add 180-minute timeout to test-suite jobs in 98b86328b6
ext/session: fix GH-21314 (session GC behaviour is different since 8.4) in fe53521e92- phpdbg: fix leaked lowercased lookup keys in phpdbg_resolve_opline_break in b6938a25ee
Khaled Alam
- Fix GH-22683: Reflection(Class)
Constant::__toString()should not warn on NAN conversions in GH-22694
Michael Orlitzky
ext/sockets/tests/gh21161.phpt: skip if no ipv6 in GH-22403ext/iconv/tests/bug76249.phpt: fallback for non-GNUiconv()in GH-22552ext/iconv/tests/bug52211.phpt: use per-iconv charset names in GH-22543ext/iconv/tests/eucjp2iso2022jp.phpt: skip for "unknown" iconv in ebbfb3c02bext/iconv/tests/iconv_mime_encode.phpt: skip for "unknown" iconv in 863263a775- ext/gd/tests/gh19{666,739}.phpt: skip for external libgd in b51f575ba1
- Alpine CI: don't install gnu-libiconv-dev in a095c57f03
Máté Kocsis
- Apply lexbor fix for empty hosts in GH-22485
- Fix macOS compatibility of update-lexbor.sh in f40c8f2b98
ext/uri: Fix GH-22629 WHATWG validation error incorrect with empty host and non-empty userinfo in GH-22699ext/uri: Fix GH-22628 Percent-encoding of caret in WHATWG URL paths is not performed in GH-22700
NickSdot
zend_objects: Readonly properties must be re-locked after clone-with in GH-22654
Nora Dossche
- openssl: Use proper error propagation when X509_dup() fails in
openssl_x509_read()in GH-21953 - Fix NULL deref when enabling TLS fails and the peer name needs to be reset in fc0f25f286
P3p111n0
Peter Kokot
- Update NEWS in 05e9a57017
Recep A.
- Fix out-of-bounds write in ext-bcmath
bccomp()viabc_str2num()in ce2ec8a707
Tim Düsterhus
- lexbor: Refresh patch files in GH-22517
- lexbor: Run
update_lexbor.sh(PHP 8.5) in cf308c858c
Volker Dusch
- Update versions for PHP 8.5.9 in dd6e76cce2
Weilin Du
ext/phar: Fix ZIP extra field length underflow in GH-22330ext/intl: FixLocale::lookup()fallback on invalid language tags in GH-22306ext/intl: FixLocale::lookup()test expectations in GH-22306ext/intl: Fix double construction leaks in GH-22386ext/intl: Fix Spoofchecker build after double construction change in GH-22386- ext/Intl: Fix IntlListFormatter double construction leak in GH-22394
- Fix GH-22395: Avoid truncating
base_convert()output at 64 characters in GH-22406 ext/phar: Fix .phar-prefixed non-magic directory handling in GH-22372- Fix GH-21705:
ZipArchive::getFromIndex()ignores FL_UNCHANGED in GH-21706 - Fix GH-22649: avoid ZipArchive comment reset crash in GH-22652
Xuyang Zhang
ext/intl: Reset IntlChar error state on method entry in GH-22500