PHP 8.1 is currently only receiving security fixes. PHP 8.1.22 is not the latest version in the series, and using this release is not recommended. PHP 8.1.29 is the latest in the series.
Downloads
Source Code
Git Clone
Use Git to clone the 8.1.22 tag from the PHP Git repository.
git clone https://github.com/php/php-src.git --depth 1 --branch php-8.1.22
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.1.22-x64NTS.zip (29.28 MiB)
php-8.1.22-x86NTS.zip (26.33 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.1.22-x64TS.zip (29.38 MiB)
php-8.1.22-x86TS.zip (26.31 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.1.22-cli-alpine
Debian-based: More compatible with other components, complete, and are widely used.
docker pull php:8.1.22-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.1.22-fpm-alpine
Debian-based ZTS Apache: Includes Apache web server integrating PHP as an Apache module.
docker pull php:8.1.22-apache
Debian-based NTS FPM: PHP-FPM, can be integrated with Nginx, Caddy, and other web servers over Fast CGI.
docker pull php:8.1.22-fpm
ChangeLog
Build
- Fixed bug GH-11522 (PHP version check fails with '-' separator).
CLI
- Fix interrupted CLI output causing the process to exit.
Core
- Fixed oss-fuzz #60011 (Mis-compilation of by-reference nullsafe operator).
- Fixed use-of-uninitialized-value with ??= on assert.
- Fixed build for FreeBSD before the 11.0 releases.
Curl
- Fix crash when an invalid callback function is passed to CURLMOPT_PUSHFUNCTION.
Date
- Fixed bug GH-11368 (Date modify returns invalid datetime).
DOM
- Fixed bug GH-11625 (
DOMElement::replaceWith()
doesn't replace node with DOMDocumentFragment but just deletes node or causes wrapping <></> depending on libxml2 version).
Fileinfo
- Fixed bug GH-11298 (finfo returns wrong mime type for xz files).
FTP
- Fix context option check for "overwrite".
- Fixed bug GH-10562 (Memory leak and invalid state with consecutive
ftp_nb_fget
).
GD
- Fix most of the external libgd test failures.
Hash
- Fix use-of-uninitialized-value in
hash_pbkdf2()
, fix missing $options parameter in signature.
Intl
- Fix memory leak in
MessageFormatter::format()
on failure.
Libxml
- Fixed bug GHSA-3qrf-m4j2-pcrr (Security issue with external entity loading in XML without enabling it). (CVE-2023-3823)
MBString
- Fix GH-11300 (license issue: restricted unicode license headers).
Opcache
- Fixed bug GH-10914 (OPCache with Enum and Callback functions results in segmentation fault).
- Prevent potential deadlock if accelerated globals cannot be allocated.
PCNTL
- Fixed bug GH-11498 (SIGCHLD is not always returned from
proc_open
).
PCRE
- Mangle PCRE regex cache key with JIT option.
PDO
- Fix GH-11587 (After php8.1, when
PDO::ATTR_EMULATE_PREPARES
is true andPDO::ATTR_STRINGIFY_FETCHES
is true, decimal zeros are no longer filled).
PDO SQLite
- Fix GH-11492 (Make test failure:
ext/pdo_sqlite/tests/bug_42589.phpt
).
Phar
- Add missing check on EVP_VerifyUpdate() in phar util.
- Fixed bug GHSA-jqcx-ccgc-xwhv (Buffer mismanagement in
phar_dir_read()
). (CVE-2023-3824)
PHPDBG
- Fixed bug GH-9669 (phpdbg -h options doesn't list the -z option).
Session
- Removed broken url support for transferring session ID.
Standard
- Fix serialization of RC1 objects appearing in object graph twice.
SQLite3
- Fix replaced error handling in SQLite3Stmt::__construct.
Commit List
Adam Saponara
- Fix GH-9669: phpdbg -h options doesn't list the -z option in 119b062169
Anatol Belski
- fileinfo: Backport xz detection fix in 86f79b299e
- NEWS: Add note for GH-11298 in 928fc68c9e
Ben Ramsey
- Update versions for PHP 8.1.22 in 5ffbd1ad43
David Carlier
zend_gdb
disable gdb detection for FreeBSD < 11 in 69b4360e88
Derick Rethans
- Fixed GH-11368: Date modify returns invalid datetime in 0747616f84
George Peter Banyard
ext/intl
: Fix memory leak inMessageFormatter::format()
in 536dbd74fa
Ilija Tovilo
- Fix arm build in bb2b1897df
- Remove session ID set through REQUEST_URI in f160eff441
- Revert "Mangle PCRE regex cache key with JIT option" in 4d91665f78
- Fix use of uninitialized memory in pcntl SIGCHLD handling in 003cf9da78
- Fix mis-compilation of by-reference nullsafe operator in dc73b73f8b
- Fix serialization of RC1 objects appearing in object graph twice in d7d36692fd
- Attempt to fix
gh11498.phpt
on MSAN in 07dd0c80a8 - Use waitpid(-1) over WAIT_ANY in 46e9c5104c
- Attempt to improve setup-slapd.sh stability in 4cc800fcb4
- Retire AppVeyor in f47dc259aa
- Fix use-of-uninitialized-value with ??= on assert in 84a2e48050
- Implement flaky test section in 849fdcae7d
- Always memoize assert in b1b7c61a27
- Fix
hash_pbkdf2
options parameter in 7cae6eb8db
Jonas
- Fix context option check for "overwrite" in FTP in 1d369a871d
Kévin Dunglas
- tests(ext-curl): fix HTTP/2 Server Push tests in 47d478806a
Michael Orlitzky
- Fix most external GD 2.3.3 compatibility in 0aaad46c15
Michael Voříšek
- Mangle PCRE regex cache key with JIT option in 466fc78d2c
nielsdos
- Fix interrupted CLI output causing the process to exit in 1111a9517b
- Fix GH-11498: SIGCHLD is not always returned from
proc_open
in f39b513916
Niels Dossche
- Add missing WUNTRACED in 931d8d059b
- Fix GH-11300: license issue: restricted unicode license headers in ee42621ff6
- Fix replaced error handling in SQLite3Stmt::__construct in 824d1f95ad
- Fix GH-10562: Memory leak and invalid state with consecutive
ftp_nb_fget
in c962a96c34 - Fix crash when an invalid callback function is passed to CURLMOPT_PUSHFUNCTION in 3ccd8d7866
- Fix return value of
_php_server_push_callback
in case of failure in dc9adda653 - Add missing check on EVP_VerifyUpdate() in phar util in 0d07b6d647
- Fix GH-11625:
DOMElement::replaceWith()
doesn't replace node with DOMDocumentFragment but just deletes node or causes wrapping <></> depending on libxml2 version in 15ff830373 - Fix GH-11629:
bug77020.phpt
tries to send mail in 06d87e4c14 - Fix GH-11630:
proc_nice_basic.phpt
only works at certain nice levels in c408a8b604 - Fix tests for stat rdev in 6b87e08b82
- Fix GH-10914: OPCache with Enum and Callback functions results in segmentation fault in bc42179133
- Add regression test for GH-11682 in 48b246e038
- Handle fragments consisting out of multiple children without a single root correctly in 5c26258eeb
- Prevent potential deadlock if accelerated globals cannot be allocated in b0bc057e86
- Fix buffer mismanagement in
phar_dir_read()
in 075c6af125 - Sanitize libxml2 globals before parsing in 0675edb933
- Disable global state test on Windows in 9949064dd1
- NEWS in 6188050779
Peter Kokot
- Fix GH-9483: Autoconf warnings for newer Autoconf versions in 41a3573fcc
SakiTakamachi
- Fix GH-11587
PDO::ATTR_STRINGIFY_FETCHES
should return strings even in ifPDO::ATTR_EMULATE_PREPARES
is enabled in e0aadc1c0d
SVGAnimate
- Fix GH-11522: PHP version check fails with '-' separator in 3483229199
Vinicius Dias
- Fix GH-11492: Make test failure:
ext/pdo_sqlite/tests/bug_42589.phpt
in 039dd0b4bd