Repository navigation
PHP 8.2.36 for FreeBSD (8.2, 05.12.2026)
PHP 8.2.36 for FreeBSD from branch freebsd/8.2, not an official PHP release.
| Upstream | php/php-src php-8.2.36 @ bbc92cfe9a4f |
| Branch commit | 8783cf1f7be1 |
php -v |
PHP 8.2.36 (...) (fork: 20261205-fbsd-bbc92cfe) |
| Tarball | php-8.2.36-fbsd-20261205-bbc92cfe.tar.xz, unpacks into php-8.2.36-fbsd-20261205-bbc92cfe/ |
| SHA-256 | fe71972e99bfcd97a227d25bbb3e491e497c26fa7ef7e3c467e4962208fcd9c7 |
FreeBSD ports patches
From freebsd-ports lang/php82 @ 438e512499a9.
Applied (commit "Apply curated FreeBSD ports patches"):
patch-TSRM_TSRM.c(TSRM/TSRM.c): Do not use the Linux aarch64 TLS assembly on FreeBSD (no effect on amd64).patch-build_Makefile.global(build/Makefile.global): 'make test' does not stop when the egrep that copies the loaded php.ini and the scanned .ini files into tmp-php.ini finds nothing (an empty php.ini, a scan directory without .ini files): BSD make runs the recipe with sh -e.patch-ext_hash_xxhash_xxhash.h(ext/hash/xxhash/xxhash.h): xxHash on PowerPC with VSX and on s390x: altivec.h and s390intrin.h included with bool, vector and pixel saved and restored (push_macro/pop_macro), as xxHash upstream; no effect on amd64.patch-php.ini-development(php.ini-development): php.ini-development: session.upload_progress.enabled = Off, a temporary mitigation of CVE-2026-115560 (and CVE-2026-109619) until the next PHP release, as the port; existing php.ini files stay as they are.patch-php.ini-production(php.ini-production): php.ini-production: session.upload_progress.enabled = Off, a temporary mitigation of CVE-2026-115560 (and CVE-2026-109619) until the next PHP release, as the port; existing php.ini files stay as they are.patch-sapi_apache2handler_config.m4(sapi/apache2handler/config.m4): 'make install' installs the module without editing httpd.conf (no apxs -a).patch-sapi_fpm_config.m4(sapi/fpm/config.m4): Report the listen queue via SO_LISTENQLEN; FreeBSD's struct tcp_info lacks the Linux fields.patch-sapi_fpm_www.conf.in(sapi/fpm/www.conf.in): Document that IPv4-mapped addresses are disabled by default on FreeBSD.
Not applied:
patch-configure.ac: three hunks are the ports build layout, which makes php_config.h include ext/php_config.h that only the port's Makefile creates (a hand build fails without it), drops the configure pthreads check and sets the ports' PEAR include_path, and two do not matter here: the nanosleep hunk (libc before librt) would only drop a NEEDED librt.so.1 (librt is part of the base system), and php-src has no include/ for the header hunk to leave out. The port has no ifunc hunk; the fork takes that of lang/php83 (compat-freebsd-ifunc.patch; aZ, 09.11.2026), so configure checks the ifunc and target attributes on FreeBSD toopatch-ext_mysqli_mysqli__api.c,patch-ext_mysqli_mysqli__nonapi.c,patch-ext_mysqli_mysqli__prop.c: ports split packaging of ext/mysqli (built alone with phpize, where the ext/mysqlnd headers are missing); not needed when building from the full source treepatch-ext_pcre_pcre2lib_sljit_sljitConfigInternal.h: PowerPC 32-bit, for the copy of PCRE2 that upstream bundles; this fork bundles PCRE2 10.49 instead (freebsd/pcre.conf), whose sljit already leaves out __builtin___clear_cache on every PowerPC (SLJIT_CONFIG_PPC, 32 and 64 bit), so its change is there alreadyphp_fpm.in: the rc.d script of the port, not a source patch; your own rc.d scripts stay in use
Build compatibility patches
By azsupport (commit "Apply build compatibility patches"):
compat-apache-module-name.patch: make install puts the Apache module into the modules directory of Apache as libphp82.so instead of libphp.so (every branch of this fork: libphpXY.so), so that the builds of several PHP versions do not overwrite each other. httpd.conf is not changed: the install names the LoadModule line it needs. (azsupport)compat-c99.patch: Fix the GNU libiconv check of ext/iconv/config.m4, which calls printf without <stdio.h>: gcc 14 and newer reject the implicit declaration, so the check failed silently and the module said ICONV_IMPL "unknown" with GNU libiconv. As in php-src 8.3 and later. (azsupport; the include as in php-src PHP-8.3 ext/iconv/config.m4)compat-freebsd-ifunc.patch: configure checks the ifunc and target function attributes on FreeBSD too, as the official port of PHP 8.3 does, so that PHP picks its SIMD code by the CPU at run time. Upstream 8.2 skips both checks on FreeBSD (PHP bug #77284, FreeBSD 11), and that code ran only where the -march of the build had the instructions: with x86-64-v3 no crc32 with PCLMUL (crc32(), the crc32 hashes), with x86-64-v2 also no base64 with AVX2. PHP 8.4 runs these checks upstream on FreeBSD 12 and later. (freebsd-ports lang/php83/files/patch-configure.ac @ eb0100f974b6, its ifunc hunk only, the same change; lang/php82 has no such hunk, the fork takes that of 8.3 (aZ, 09.11.2026))compat-openssl-legacy-provider.patch: --with-openssl-legacy-provider of PHP 8.4: load the OpenSSL 3 legacy provider (RC4, Blowfish, DES, RC2, CAST5, MD4 and others) together with the default provider at startup; off by default, no change with OpenSSL 1.1. (php-src PHP-8.4 ext/openssl/config0.m4 and openssl.c (phpGH-13951, "ext/openssl: Add option to load legacy algorithm provider"), the same code)
Interim security backports
By azsupport, carried only until the upstream branch has its own fix; not reviewed upstream:
- php-fpm: the status page and fpm_get_status() under load failed with "scoreboard: failed to lock (already locked)" while a worker updated the scoreboard, as readers and writers took one spin lock and a reader did not wait (phpGH-13437); a reader count and a writer flag now, the readers waiting for the writer and the writers for the readers, with a limit of retries for a crashed one (php-src commit 3490ac0 (Jakub Zelenka, 07.09.2024, PHP 8.3.16), the commit of upstream that Ubuntu took in place of its first backport for 8.3.6 (noble, fix-fpm-scoreboard.patch, LP #2130569 and #2144556: the first one crashed php-fpm))
- mysqlnd, the greeting of the server: the 12 bytes of the second part of the scramble were copied when one byte of them was left in the packet, so that a greeting that ended inside them gave the bytes after the packet in the command buffer, or after that buffer, to the scramble (an over-read a hostile or man-in-the-middle server triggers; the fix of GHSA-r6x9-5r99-36j7 left it out, php-src has it too); the 12 bytes and the 0x0 after them have to be in the packet now, otherwise the greeting fails as too short. Two tests for the fake MySQL server, their scenarios in ext/mysqli/tests/fake_server.inc (azsupport: our check of PHP 5.6 (backport-mysqlnd-overread.patch, 22.10.2026 to 04.12.2026) with its test and scenario, the bound of php-src pull request 26018 (Ian Mattas, 02.12.2026, open, not merged): it counts the 0x0 after the 12 bytes too, stricter than our check, and a greeting of MySQL or MariaDB always has it; the second test is for that byte)
- CVE-2024-11235 (GHSA-rwp7-7vc6-8477): the live range of the temporary that ZEND_SEPARATE defines again was ended there, which broke the handling of COPY_TMP: ??= on a property of the result of a call ($a->f()->p ??= ..., f()->p ??= ...), with __set or a typed property that throws, freed the value twice (a use-after-free). Fixed upstream in 8.3.19 and 8.4.5 only; the same code (zend_calc_live_ranges()) is in this branch (php-src commit ef2c459 (Ilija Tovilo, 13.11.2024, PHP 8.3.19), with its three tests, as SUSE carries it for 7.4.33 and 8.0.30 (php7-CVE-2024-11235.patch, SLE 15) and Ubuntu for 7.4 (focal) and 8.1 (jammy) (CVE-2024-11235.patch))
- php_zip_pcre() (addPattern()) freed only the current name when a path was too long and returned, leaking the rest of the list (PHP 8.4.23, not in this branch); its tests taken (php-src commit c4d4cea (ndossche, 06.06.2026, PHP 8.4.23))
- getFromName() and getFromIndex() did not close the entry when zip_fread() failed or read nothing (PHP 8.4.23, not in this branch); its tests taken (php-src commit 17f6752 (ndossche, 06.06.2026, PHP 8.4.23))
- phpGH-21705: getFromIndex() with ZipArchive::FL_UNCHANGED stated the current entry instead of the original, so it read the wrong length of a changed entry (PHP 8.4.24, not in this branch); its tests taken (php-src commit bc3a7c7 (Weilin Du, 03.07.2026, PHP 8.4.24))
- phpGH-22649: setting the inherited comment of an entry again after the entry was overwritten used a comment libzip had freed (a use-after-free in PHP_ZIP_SET_FILE_COMMENT) (PHP 8.4.24, not in this branch); its tests taken (php-src commit ebed41a (Weilin Du, 10.07.2026, PHP 8.4.24))
- phpGH-23108: addGlob() and addPattern() without options stored the entries uncompressed and failed on an existing name instead of replacing it, the defaults being applied only with an options array (PHP 8.4.25, not in this branch); here zip_options was not initialized at all without an options array (remove_path and add_path read from the stack): the defaults are set at its declaration, the memset and defaults of php_zip_parse_options() of 8.2 dropped; its tests taken (php-src commit 8d5b0d6 (David Carlier, 08.08.2026, PHP 8.4.25))
- phpGH-17787: a stream of getStream() borrows the zip_t of the archive; freeing the ZipArchive while the stream was open closed the archive under it (a short read, the pending changes lost); the stream keeps the archive alive now (PHP 8.4.26, not in this branch); its tests taken (php-src commit 5a326b9 (Eyüp Can Akman, 14.08.2026, PHP 8.4.26))
- phpGH-23240: extractTo() took a failed read (the CRC error of a corrupted entry) for success and wrote the corrupt data, and getFromName() and getFromIndex() never read up to the CRC check and returned such data silently; read errors fail with a warning now (PHP 8.4.26, not in this branch); the n of php_zip_get_from() of 8.2 is an int: zip_int64_t now; its tests taken (php-src commit 2a2b337 (David Carlier, 13.08.2026, PHP 8.4.26))
- phpinfo() reported the AES-128 support for AES-192 and AES-256 (PHP 8.4.26, not in this branch); its tests taken (php-src commit d9c58ee (Weilin Du, 17.08.2026, PHP 8.4.26))
- phpGH-23276: with the stream keeping the archive alive, a ZipArchive subclass holding its own stream was a cycle the GC could not collect; the native state of the archive (zip_t, callbacks) is a refcounted object of its own now, which the streams keep (PHP 8.4.26, not in this branch); brought onto php_zip_add_file(), php_zip_add_from_pattern() and the callback registration of 8.2 by hand; its tests taken (php-src commit f49b94e (Weilin Du, 25.08.2026, PHP 8.4.26))
- getNameIndex() cast the index to int, so an index past 2^32 wrapped and named another entry (PHP 8.4.26, not in this branch); its tests taken (php-src commit 473a7e0 (David Carlier, 29.08.2026, PHP 8.4.26))
- phpGH-23511: fstat() of a zip:// stream succeeded with an empty stat when the archive could not be opened (PHP 8.4.26, not in this branch); its tests taken (php-src commit 614afe7 (David Carlier, 29.08.2026, PHP 8.4.26))
- extractTo() with an array of names that is not a list skipped the names whose key was not an index below the count (PHP 8.4.27, not in this branch); php_zip_extract_file() of 8.2 has no index argument; its tests taken (php-src commit 214ed7e (David Carlier, 10.09.2026, PHP 8.4.27))
- phpGH-23747: close() or open() called from a progress or cancel callback ran a nested zip_close() and freed the archive the outer zip_close() still used (a use-after-free); they throw meanwhile now (PHP 8.4.27, not in this branch); its tests taken (php-src commit 132403d (David Carlier, 18.09.2026, PHP 8.4.27))
- phpGH-23779: a ZipArchive destroyed without close() while its progress or cancel callback ran nested zip_close() and freed the archive in use (a use-after-free); no new stream while closing, no callback destructors after the engine shutdown (PHP 8.4.28, not in this branch); its tests taken (php-src commit 303e6aa (jvoisin, 19.09.2026, PHP 8.4.28))
- phpGH-24025: a progress or cancel callback could delete or unchange entries inside zip_close() after libzip had fixed its list (a use-after-free of a dirent) or change the archive with the changes dropped; every mutator throws "Already being closed" then (PHP 8.4.28, not in this branch); the checks placed by hand as upstream, without setArchiveFlag() (8.3 and later), also in its test; its tests taken (php-src commit acd5fe8 (Ilia Alshanetsky, 24.09.2026, PHP 8.4.28))
- phpGH-21698: addGlob() did not free the glob() result when no file matched or open_basedir refused the match (PHP 8.4.21, not in this branch); with the array_init() of the no-match return here; its test expects NULL, which addGlob() returns here when open_basedir refuses the match; its tests taken (php-src commit 391ec27 (David Carlier, 10.04.2026, PHP 8.4.21))
- SOAP: the DTD node that the fix of GHSA-4646-p932-gw34 keeps in the document is named after its DOCTYPE, so the lookups of an element by its name (the Envelope of a request, the definitions of a WSDL, a schema) could take the DTD for that element and read its fields as those of an element; only elements match now, and the root is copied when the to_xml() callback of a typemap puts a DOCTYPE or a processing instruction before it (phpGH-25628); with its tests (php-src commit 7d0baa8 (Jakub Zelenka, 19.11.2026, merged 30.11.2026; not in php-8.2.36, php-8.3.37, php-8.4.28, php-8.5.13), without its NEWS; Remi Collet's 7.4 and 8.1 branches carry it since 04.12.2026 (98b160a, 8acdc6c))
Bundled PECL extensions
In ext/ (commit "Bundle PECL extensions"), built only when enabled with their option:
- redis 6.3.0 (phpredis/phpredis @
df4fab2de7fc):--enable-redis - memcached 3.4.0 (php-memcached-dev/php-memcached @
ce37962769fc):--enable-memcached --with-libmemcached-dir=/usr/local --disable-memcached-sasl(packagelibmemcached) - memcache 8.6 (websupport-sk/pecl-memcache @
56bef9e138da):--enable-memcache; patchmemcache-8.6.patch: Build inside php-src as ext/memcache (bundled by this fork), not only with phpize: config9.m4 looked for its src/ sources under abs_srcdir, which is the PHP tree there, and its PHP version test could not find php_version.h, so configure stopped ("checking PHP version... unknown"); main/internal_functions.c needs ext/memcache/php_memcache.h for phpext_memcache_ptr. config9.m4 now uses PHP_EXT_SRCDIR(memcache), the extension directory in both cases, adds main/ for the version test, and a top-level php_memcache.h includes src/php_memcache.h. - imagick 3.8.1 (Imagick/imagick @
70087bab33ea):--with-imagick=/usr/local(packageImageMagick7orImageMagick7-nox11; not together with gmagick); patchimagick-3.8.1.patch: Build inside php-src as ext/imagick (bundled by this fork): buildconf runs in the top of the PHP tree, where m4_include of imagemagick.m4 finds no file, so config.m4 now includes ext/imagick/imagemagick.m4; and set the version that PECL packaging fills in ("@PACKAGE_VERSION@" in the git sources) to 3.8.1, for phpversion('imagick'). - gmagick 2.0.6RC1 (vitoc/gmagick @
2936e731e964):--with-gmagick=/usr/local(packageGraphicsMagick; not together with imagick); patchgmagick-2.0.6RC1.patch: Build inside php-src as ext/gmagick (bundled by this fork): configure stops when --with-imagick is given too. GraphicsMagick and ImageMagick have the same MagickWand function names, so built into one PHP, gmagick and imagick would call each other's library. Also the generated arginfo of thresholdimage() and negateimage(): the default of $channel is Gmagick::CHANNEL_DEFAULT, not the undefined global constant CHANNEL_DEFAULT (ReflectionParameter::getDefaultValue() threw "Undefined constant"; the stub was corrected upstream in 0f96aa3, its arginfo was not). - igbinary 3.2.16 (igbinary/igbinary @
8326f6a69ebb):--enable-igbinary; the igbinary serializer of redis and memcached:--enable-redis-igbinary,--enable-memcached-igbinary - swoole 6.3.0 (swoole/swoole-src @
e0d606594e13):--enable-swoole(OpenSSL when PHP is built--with-openssl; brotli compression with the packagebrotli); patchswoole-6.3.0.patch: Build inside php-src as ext/swoole (bundled by this fork): the default of --enable-swoole was "yes", which built it into every PHP configured without --disable-all; it is now "no"; drop the -std=c++14 that config.m4 appends to CXXFLAGS, which inside php-src applies to every C++ file and overrides the C++17 that ext/intl needs with ICU 75 and newer. - openswoole 4.12.1 (openswoole/ext-openswoole @
b4a458b59e18):--enable-openswoole(OpenSSL when PHP is built--with-openssl; not together with swoole); patchopenswoole-4.12.1.patch: Build inside php-src as ext/openswoole (bundled by this fork), on PHP 7.4 to 8.4. configure built OpenSwoole into every PHP, as it tested PHP_SWOOLE (left over from swoole, unset there) instead of PHP_OPENSWOOLE, and the default of --enable-openswoole was "yes"; now only --enable-openswoole builds it, and configure stops when --enable-swoole is given too (same C++ symbols). Drop the option --enable-openssl, which reset PHP_OPENSSL of --with-openssl to "no" so that mysqlnd built without its OpenSSL code (OpenSwoole now uses OpenSSL when PHP is built --with-openssl, as swoole 6.2 does); drop the -std=c++11 that config.m4 appends to CXXFLAGS, which inside php-src applies to every C++ file and overrides the C++17 that ext/intl needs with ICU 75 and newer; include <stdint.h> in swoole_proxy.h (uint8_t unknown with clang 19). For PHP 8.3 and 8.4, which OpenSwoole 4.12 does not support upstream (OpenSwoole 22 and newer changed the API): the new php_url_encode_hash_ex() of 8.3; zend_str_tolower() for php_strtolower(), gone in 8.4; the C stack bounds that PHP 8.3 checks (EG(stack_base), EG(stack_limit)) follow the coroutine stacks, as in swoole 5.1 and newer, so calls inside coroutines no longer fail with "Maximum call stack size reached"; as 8.4 made exit a function (no ZEND_EXIT opcode), the function exit() is wrapped the way the opcode was, so exit in a coroutine or a server still throws Swoole\ExitException; and the embedded PHP library declares its nullable parameters explicitly (?int, ?array), which PHP 8.4 asks for with a deprecation notice at every start; and the two C++ header checks of configure (valgrind, boost stacktrace) use AC_LANG_PUSH/POP instead of AC_LANG([C++]), which left configure in C++ for every extension after it: their checks ran as C++, and for example readline was not found. On FreeBSD, thirdparty/hiredis/fmacros.h no longer defines _XOPEN_SOURCE and _POSIX_C_SOURCE: they hide the BSD types (u_int32_t) that <netinet/ip6.h> needs, which hiredis/net.c includes through swoole_socket.h, and the build stopped there. And include/swoole_socket.h includes <sys/types.h> first: on FreeBSD the socket headers do not include it, and <netinet/ip6.h> needs its u_int32_t, u_int16_t and u_int8_t. - excimer 1.2.8 (wikimedia/excimer @
563e37489270):--enable-excimer; patchexcimer-1.2.8.patch: Build inside php-src as ext/excimer (bundled by this fork) and on FreeBSD: pass -fvisibility=hidden for the excimer sources only (config.m4 added it to CFLAGS, which inside php-src is that of the whole build); on FreeBSD take the thread id for SIGEV_THREAD_ID from pthread_getthreadid_np(), as FreeBSD has neither gettid() nor SYS_gettid, so the timer backend of 1.2.4 and later did not compile there (the FreeBSD port devel/pecl-excimer stays at 1.2.3). - mcrypt 1.0.9 (php/pecl-encryption-mcrypt @
ee7378051c17):--with-mcrypt=/usr/local(packagelibmcrypt) - ssh2 1.6.0 (php/pecl-networking-ssh2 @
37afb36ed226):--with-ssh2=/usr/local(packagelibssh2) - gearman 2.2.1 (php/pecl-networking-gearman @
554a7c93b028):--with-gearman=/usr/local(packagegearmandorgearmand-opensslof azsupport/ports)
Bundled PCRE
Commit "Bundle PCRE":
- PCRE2 10.49 (release tarball, SHA-256
53c156e1ba416a20, the same as in freebsd-portsdevel/pcre2) inext/pcre/pcre2libinstead of the copy upstream bundles; every function of it is renamed tophp_pcre*(main/php_compat.h), so a PCRE library that another module loads into the same process (the libpcre2 of Apache) stays separate;tests-8.2.patch: ext/pcre tests that print messages of the library: the wording of PCRE2 10.37+ ("atomic assertion expected", the offset after the character) as well as the old one, as php-src has them since 8.1 and 8.3.--with-external-pcrestill takes the library of the system.
Bundled curl
In ext/curl/libcurl (commit "Bundle curl"), used only with --with-curl=bundled:
- curl 8.23.0 (release tarball, SHA-256
8dadd7d2536a314f) inext/curl/libcurl; patchcurl-8.23.0.patch(freebsd-ports): FreeBSD ports patch of the curl configure: accept -D in CFLAGS and -l in LDFLAGS, keep the -O flags of CFLAGS (PR 150854, 177401, 180944); conncache: an idle HTTP/1.1 connection with input pending is not reused (the stray bytes came back as the response to the next request, and every later one was shifted), and the libraries it needs inext/curl/deps: c-ares 1.34.9, nghttp2 1.71.0, brotli 1.2.1, zstd 1.6.0, libidn2 2.3.8, libpsl 0.23.3, libssh2 1.11.1, with the public suffix list of 31.10.2026 (their upstream release files,freebsd/curl-deps.conf).--with-curl=bundledbuilds all of it into PHP, static, with the OpenSSL of the build (3.0 or later, so not FreeBSD 13.x base): no package needed. c-ares resolves names (a lookup that runs into the timeout ends at once); left out: IMAP, POP3, SMTP, WebSocket, NTLM, DICT, Gopher, IPFS, MQTT, RTSP, Telnet, TFTP, LDAP, GSSAPI; SCP and SFTP with libssh2. Plain--with-curlstill takes the libcurl of the system.
Build options of this fork
Commit "Add the build options of this fork", off unless given to configure:
--enable-opcache-static: OPcache built into PHP instead of opcache.so, as PHP 8.5 always does: the module registers the zend_extension in its MINIT, and the startup of the zend_extension registers the INI entries after its globals, in the order opcache.so has. No zend_extension line is needed; zend_extension=opcache.so is skipped quietly, also when an old opcache.so is still in extension_dir. Without the option opcache.so is built as before. Not with ZTS and the JIT: before PHP 8.5 the JIT reaches thread-local data in a way that works only from opcache.so, so configure stops (add --disable-opcache-jit, or build opcache.so). With OPcache built in, opcache.huge_code_pages is ignored with one warning at startup (ini_get and phpinfo still show the configured value), since remapping the code of the PHP binary would remap the remapping code too and crash.--disable-extension-loading: PHP loads no extensions at run time: extension= and zend_extension= lines, dl() and php -z are refused with a warning that names the file, a line for an extension that is built in (extension=mysqli) is skipped quietly, phpinfo() shows "Dynamic Library Support: disabled", and configure stops when an extension would be built as .so (OPcache: --enable-opcache-static). Without the option nothing changes.PHP_BUILD_PROVIDER=<text> in the environment of configure: in the HTML of phpinfo() an https:// address in the row "Build Provider" (PHP_BUILD_PROVIDER of configure) is a link; as text, and without an address, the row is that of upstream. Without the variable there is no row, as before.
Build
Extract, then in the new directory write the configure options of the installed PHP with tools/config-check.sh (sh config-check.sh /usr/local/phpXY, or sh config-check.sh --pkg where PHP comes from packages), run sh config.installed.sh (extra options, such as those of the bundled PECL extensions, go after it), then make and make install. Copy-paste blocks per version are in the README.