PHP 8.1 is currently only receiving security fixes. PHP 8.1.21 is not the latest version in the series, and using this release is not recommended. PHP 8.1.30 is the latest in the series.
Downloads
Source Code
git clone https://github.com/php/php-src.git --depth 1 --branch php-8.1.21
./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
Docker/Podman Containers
docker pull php:8.1.21-cli-alpine
docker pull php:8.1.21-cli
docker pull php:8.1.21-fpm-alpine
docker pull php:8.1.21-apache
docker pull php:8.1.21-fpm
ChangeLog
CLI
- Fixed bug GH-11246 (cli/get_set_process_title fails on MacOS).
Core
- Fixed build for the riscv64 architecture/GCC 12.
Curl
- Fixed bug GH-11433 (Unable to set CURLOPT_ACCEPT_ENCODING to NULL).
DOM
- Fixed bugs GH-11288 and GH-11289 and GH-11290 and GH-9142 (DOMExceptions and segfaults with replaceWith).
- Fixed bug GH-10234 (Setting
DOMAttr::textContent
results in an empty attribute value). - Fix return value in stub file for
DOMNodeList::item
. - Fix spec compliance error with '*' namespace for
DOMDocument::getElementsByTagNameNS
. - Fix
DOMElement::append()
andDOMElement::prepend()
hierarchy checks. - Fixed bug GH-11347 (Memory leak when calling a static method inside an xpath query).
- Fixed bug #67440 (append_node of a DOMDocumentFragment does not reconcile namespaces).
- Fixed bug #81642 (
DOMChildNode::replaceWith()
bug when replacing a node with itself). - Fixed bug #77686 (Removed elements are still returned by getElementById).
- Fixed bug #70359 (
print_r()
on DOMAttr causes Segfault inphp_libxml_node_free_list()
). - Fixed bug #78577 (Crash in DOMNameSpace debug info handlers).
- Fix lifetime issue with getAttributeNodeNS().
- Fix "invalid state error" with cloned namespace declarations.
- Fixed bug #55294 and #47530 and #47847 (various namespace reconciliation issues).
- Fixed bug #80332 (Completely broken array access functionality with DOMNamedNodeMap).
Opcache
- Fix allocation loop in
zend_shared_alloc_startup()
. - Access violation on smm_shared_globals with ALLOC_FALLBACK.
- Fixed bug GH-11336 (php still tries to unlock the shared memory ZendSem with opcache.file_cache_only=1 but it was never locked).
OpenSSL
- Fixed bug GH-9356 Incomplete validation of IPv6 Address fields in subjectAltNames
PGSQL
- Fixed intermittent segfault with pg_trace.
Phar
- Fix cross-compilation check in phar generation for FreeBSD.
SPL
- Fixed bug GH-11338 (SplFileInfo empty getBasename with more than one slash).
Standard
- Fix access on NULL pointer in
array_merge_recursive()
. - Fix exception handling in
array_multisort()
.
Commit List
Daniil Gentili
- Fix GCC 12 compilation on riscv64 in 1dfa277a96
David CARLIER
ext/pgsql
: fix PGtrace invalid free issue in f194cdf852
divinity76
- Fix return value in stub file for
DOMNodeList::item
in 761b9a44f8
Dmitry Stogov
- Fixed deoptimization info for interrupt handler in 8f06febedf
- Keep consistent EG(current_execute_data) after return from generator in GH-11380
- Fixed incorrect VM stack overflow checks elimination in 1a96d64828
Ilija Tovilo
- Fix access on NULL pointer in
array_merge_recursive()
in f5c54fd88b - Fix exception handling in
array_multisort()
in b2ec6c24f8
Jakub Zelenka
- Fix CS and checking for IPv6 SAN verify in 3fc013b2e2
- FPM: Add "pcntl" when running another test depending on pcntl in 9b18466396
James Lucas
- Fix bug GH-11246 cli/get_set_process_title in c6ae7a55b7
- Fix bug GH-9356: Incomplete SAN validation of IPv6 address in fd09728bb6
KoudelkaB
- Access violation when ALLOC_FALLBACK fixed in 8946b7b141
Mikhail Galanin
- sapi/fpm: add "pcntl" when running test depending
pcntl_sigprocmask()
in 7ade242e28
nielsdos
- Fix allocation loop in
zend_shared_alloc_startup()
in 6267601f84 - Fix GH-11288 and GH-11289 and GH-11290 and GH-9142: DOMExceptions and segfaults with replaceWith in cba335d61e
- Fix
DOMElement::append()
andDOMElement::prepend()
hierarchy checks in b374ec399d - Fix GH-11347: Memory leak when calling a static method inside an xpath query in 7812772105
- Fix test failure for
init_fcall_003.phpt
without opcache in cced0ddf9d - Fix #70359 and #78577: segfaults with DOMNameSpaceNode in f2d673fb18
- Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL in a8a3b99e00
- Fix bug #55294 and #47530 and #47847: namespace reconciliation issues in b30be40b86
- Fix GH-11404:
DOMDocument::savexml
and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM in 7eb3e9cd17 - Revert "Fix GH-11404:
DOMDocument::savexml
and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM" in c174ebfce0
Niels Dossche
- Fix GH-10234: Setting
DOMAttr::textContent
results in an empty attribute value in c473787abb - Fix GH-11338: SplFileInfo empty getBasename with more than one slash in bce536067c
- Fix GH-11336: php still tries to unlock the shared memory ZendSem with opcache.file_cache_only=1 but it was never locked in 9c59d22a7b
- Fix spec compliance error for
DOMDocument::getElementsByTagNameNS
in 154c251013 - Fix bug #67440: append_node of a DOMDocumentFragment does not reconcile namespaces in b1d8e240e6
- Fix bug #81642:
DOMChildNode::replaceWith()
bug when replacing a node with itself in 23f7002527 - Fix bug #77686: Removed elements are still returned by getElementById in 0e34ac864a
- Fix missing randomness check and insufficient random bytes for SOAP HTTP Digest in ac4254ad76
- Fix lifetime issue with getAttributeNodeNS() in e309fd8461
- Fix "invalid state error" with cloned namespace declarations in 10d94aca4c
- Fix #80332: Completely broken array access functionality with DOMNamedNodeMap in 9f7d88802e
Patrick Allaert
- Update versions for PHP 8.1.21 in badfe4fbda
Peter
- Fix cross-compilation check in phar generation for FreeBSD in 4fcb3e0d34
Pierrick Charron
- Update NEWS in b720ab99f8
- Update NEWS in 5604f7ae22
Remi Collet
- Fix GH-11382 add missing hash header for bin2hex in 0572448263
Yuya Hamada
- Fix
mb_strlen
is wrong length for CP932 when 0x80 in c50172e812