PHP 8.1 is currently only receiving security fixes. PHP 8.1.17 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.17 tag from the PHP Git repository.
git clone https://github.com/php/php-src.git --depth 1 --branch php-8.1.17
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.17-x64NTS.zip (29.26 MiB)
php-8.1.17-x86NTS.zip (26.32 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.17-x64TS.zip (29.37 MiB)
php-8.1.17-x86TS.zip (26.30 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.17-cli-alpine
Debian-based: More compatible with other components, complete, and are widely used.
docker pull php:8.1.17-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.17-fpm-alpine
Debian-based ZTS Apache: Includes Apache web server integrating PHP as an Apache module.
docker pull php:8.1.17-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.17-fpm
ChangeLog
Core
- Fixed incorrect check condition in ZEND_YIELD.
- Fixed incorrect check condition in type inference.
- Fixed overflow check in OnUpdateMemoryConsumption.
- Fixed bug GH-9916 (Entering shutdown sequence with a fiber suspended in a Generator emits an unavoidable fatal error or crashes).
- Fixed bug GH-10437 (Segfault/assertion when using fibers in shutdown function after bailout).
- Fixed SSA object type update for compound assignment opcodes.
- Fixed language scanner generation build.
- Fixed
zend_update_static_property()
callingzend_update_static_property_ex()
misleadingly with the wrong return type. - Fix bug GH-10570 (Fixed unknown string hash on property fetch with integer constant name).
- Fixed
php_fopen_primary_script()
call resulted onzend_destroy_file_handle()
freeing dangling pointers on the handle as it was uninitialized.
Curl
- Fixed deprecation warning at compile time.
- Fixed bug GH-10270 (Unable to return CURL_READFUNC_PAUSE in readfunc callback).
Date
- Fix GH-10447 ('p' format specifier does not yield 'Z' for 00:00).
FFI
- Fixed incorrect bitshifting and masking in ffi bitfield.
Fiber
- Fixed assembly on alpine x86.
- Fixed bug GH-10496 (segfault when garbage collector is invoked inside of fiber).
FPM
- Fixed bug GH-10315 (FPM unknown child alert not valid).
- Fixed bug GH-10385 (FPM successful config test early exit).
Intl
- Fixed bug GH-10647 (Spoolchecker isSuspicious/areConfusable methods error code's argument always returning NULL0.
JSON
- Fixed JSON scanner and parser generation build.
MBString
ext/mbstring
: fix new_value length check.- Fix bug GH-10627 (
mb_convert_encoding
crashes PHP on Windows).
Opcache
- Fix incorrect page_size check.
- Fix readonly modification check when using inc/dec operators on readonly property with JIT.
OpenSSL
- Fixed
php_openssl_set_server_dh_param()
DH params errors handling.
PDO OCI
- Fixed bug #60994 (Reading a multibyte CLOB caps at 8192 chars).
PHPDBG
- Fixed bug GH-10715 (heap buffer overflow on
--run
option misuse).
PGSQL
- Fix GH-10672 (pg_lo_open segfaults in the strict_types mode).
Phar
- Fix incorrect check in phar tar parsing.
Reflection
- Fixed bug GH-10623 (
Reflection::getClosureUsedVariables
opcode fix with variadic arguments). - Fix Segfault when using ReflectionFiber suspended by an internal function.
Session
- Fixed
ps_files_cleanup_dir()
on failure code paths with -1 instead of 0 as the latter was considered success by callers.
Standard
- Fixed bug GH-10292 (Made the default value of the first param of
srand()
andmt_srand()
unknown). - Fix incorrect check in cs_8559_5 in
map_from_unicode()
. - Fix bug GH-9697 for reset/end/next/
prev()
attempting to move pointer of properties table for certain internal classes such as FFI classes - Fix incorrect error check in browsecap for pcre2_match().
Tidy
- Fix memory leaks when attempting to open a non-existing file or a file over 4GB.
- Add missing error check on tidyLoadConfig.
Zlib
- Fixed output_handler directive value's length which counted the string terminator.
Commit List
Aaron Piotrowski
Arnaud Le Blanc
- Handle non-INDIRECT symbol table entries in
zend_fiber_object_gc()
in GH-10386 - Prevent dtor of generator in suspended fiber in GH-10462
- Fix colletion of unfinished function call in fibers in d721dcc2ef
Ben Ramsey
- Update NEWS in ba282f1b2f
- Point to the issue tracker on GitHub in 586e81b259
- Use gtar if it's in the PATH in 843ba82b53
- Ensure tar is not bsdtar in d9ac59b0a9
Bob Weinand
- Fix resetting
ZEND_GENERATOR_IN_FIBER
flag in b9bca2dadb - Look at executing generator for fiber destructor behaviour in 00be6e1aed
- Fix GH-10496: Fibers must not be garbage collected while implicitly suspended by resumption of another fiber in 95016138a5
Danack
- Re-enable UnixODBC testing in 939c546ea1
Daniel Black
ext/json
: addphp_json_scanner_defs.h
as make target in 2fde3afffb- ext/Zend:
zend_language_scanner_defs.h
as make target in e83cda0887 - zend win32 RE2C header files to Make targets and generated_files in 2b3fa5edac
Daniil Gentili
- Fix segfault when using ReflectionFiber (fixes GH-10439) in 8d1c0a1403
Derick Rethans
- Sync with timelib 2021.19 in ce877da23b
- Fixed GH-10447: 'p' format specifier does not yield 'Z' for 00:00 in a42bf93308
Dmitry Stogov
- Fix incorrect compilation of FE_FETCH with predicted empty array in 7d68f9128e
- Fix type inference in 81607a62ca
- Fix possible exit_counters memory leak in ZTS build in a21195650e
- Fix (at lease part of the) #GH-10635: ARM64 function JIT causes impossible assertion in 08e7591206
- Fix GH-10635: ARM64 function JIT causes impossible assertion in GH-10638
- Fix incorrect inheritance cache update in GH-10719
- Fix Zend/tests/type_declarations/variance/class_order_autoload1.phpt in 18b43d2950
George Peter Banyard
- Fix memory leaks in ext-tidy in 704aadd098
- Fix GH-10672 (pg_lo_open segfaults in the strict_types mode) in 5f357f341d
- The userland constants do not start with PHP_ in 6a5b3f0ff9
- Fixed ValueError message in
substr_compare()
in 2133970152 - Fixed ValueError message in
count_chars()
in adc5edd411
Ilija Tovilo
- Disable timestamp for GitHub actions ccache in c95125d370
- Mark test as
XFAIL
in 13c34aac05 - Temporarily disable odbc in ci in 18b611d6a0
- Revert "Fix GH-10168: heap-buffer-overflow at zval_undefined_cv" in 7b68ff46da
Jakub Zelenka
- Fix GH-10315: FPM unknown child alert not valid in 4199b72c50
- Fix repeated warning for file uploads limit exceeding in e45850c195
- Introduce max_multipart_body_parts INI in 716de0cff5
- Update NEWS in 054c7b09f9
- Fix incorrect character in NEWS in caaaf75990
- Change NEWS for GHSA-54hq-v5wp-fqgv as it is for all SAPIs in eef29d434a
- Fix missing colon in NEWS in 937b1e38e2
- Add max_multipart_body_parts info into php.ini files in fd3cc17cbd
- Fix
php_json_scanner_defs.h
target in ext/json/Makefile.frag in 4f731fa2ec - Update NEWS with scanner and parser build fixes in a9e4f51844
Kévin Dunglas
- make clean: remove ext/opcache/minilua in c4c861b01a
Max Kellermann
- github/workflows/push.yml: enable ccache in f7e678476f
- ext/opcache/
zend_jit
: cast function to fix -Wincompatible-pointer-types in GH-10527 - ext/opcache/
zend_jit
: call TSRM dtor before unloading opcache.so in GH-10533 - Zend/
zend_cpuinfo
, ext/standard/crc32_x86: fix -Wstrict-prototypes in 0752baa583 - php.ini-production: disable
opcache.h
uge_code_pages by default in e6281db857 ext/curl
: suppress -Wdeprecated-declarations in 8c8a38a75cext/mbstring
: fix new_value length check in 243865ae57- Zend/
zend_ini
: fixzend_result
return values in d51eb1d74c - ext/curl/interface: fix
zend_result
return value in ed4dc39e7f
Michael Voříšek
- Fix PDO OCI Bug #60994 (Reading a multibyte CLOB caps at 8192 chars) in 4df4264ac9
Máté Kocsis
- Fix GH-10292 1st param of
mt_srand()
has UNKNOWN default on PHP <8.3 in 3197104e85
NathanFreeman
- Fix GH-10647: Spoofchecker isSuspicious/areConfusable methods in 0a466e7ad8
ndossche
- Add missing error check on tidyLoadConfig in f592f75e9c
- Fix incorrect error check in browsecap for
pcre2_match()
in 8cac8306c3
nielsdos
- Fix Tidy tests failing due to different spelling in 74c880edd1
- Propagate errors correctly in
ps_files_cleanup_dir()
in da3ce6015d - Fix incorrect type for return value of
zend_update_static_property_ex()
in 8959ff39d8
Niels Dossche
- Fix incorrect check condition in
ZEND_YIELD
in b5e9bf7775 - Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed in 0801c567dc
- Fix duplicated FILE section in test
bug80747.phpt
in 974dba3b80 - Fix incorrect bitshifting and masking in ffi bitfield in GH-10403
- Fix incorrect check condition in type inference in GH-10425
- Fix incorrect page_size check in b7a158a19b
- Fix incorrect check in cs_8559_5 in
map_from_unicode()
in a8c8fb2564 - Fix overflow check in OnUpdateMemoryConsumption in GH-10456
- Fix incorrect check in phar tar parsing in ec4939b170
- Fix GH-10385: FPM successful config test early exit in 5b13e83074
- Sync boost/context assembly files for fibers in 49551d7c29
- Fix GH-10168: heap-buffer-overflow at zval_undefined_cv in 71ddede565
- Fix array overrun when appending slash to paths in ec10b28d64
- Fix assertion failure when var_dump'ing void FFI result in GH-10568
- Fix updating SSA object type for *_ASSIGN_OP in GH-10458
- Fix GH-10623:
ReflectionFunction::getClosureUsedVariables()
returns empty array in presence of variadic arguments in ae16471628 - Fix GH-10627:
mb_convert_encoding
crashes PHP on Windows in ed0c0df351 - Fix incorrect string length for output_handler in zlib ini code in c510083c8c
- Fix GH-10570: Assertion `(key)->h != 0 && "Hash must be known"' failed in b9a5bfc355
- Fix GH-10692: PHP crashes on Windows when an inexistent filename is executed in df579adac7
- Fix format string mistake in
accel_move_code_to_huge_pages()
in eb7bb3430b - Fix incorrect error checking in
php_openssl_set_server_dh_param()
in b09be29ac1 - Fix GH-10715: phpdbg heap buffer overflow -- by misuse of the option "
--run
" in 0f21cbc57c - Fix module shutdown crash during ZTS JIT shutdown in 40a1a86f0c
Patrick Allaert
- Update versions for PHP 8.1.17 in 6bdc7fee4a
Pierrick Charron
- Fixed bug GH-10270 Unable to return CURL_READFUNC_PAUSE in readfunc callback in 91db3a1b85
Remi Collet
- more config for new FPM tests in e86d8704b4
Stanislav Malyshev
- Update NEWS in af2ddc6426
- Update NEWS in b5ccaaf613
Tim Düsterhus
- crypt: Fix validation of malformed BCrypt hashes in c840f71524
- crypt: Fix possible buffer overread in
php_crypt()
in a92acbad87
Tyson Andre
- Avoid crash for reset/end/next/
prev()
on ffi classes in GH-9711