Repository navigation
Description
What happened?
The frankenphp-linux-x86_64 static binary from v1.13.2 crashes PHP threads with SIGILL as soon as hash('sha256', ...) is called on a CPU that lacks the SHA extensions (sha_ni). v1.13.1 (current asset, also PHP 8.5.12) works on the same machine. It looks like the SHA-256 implementation uses SHA-NI without a runtime CPU check since the move to static-php-cli v3.
Environment
- Binary:
frankenphp-linux-x86_64v1.13.2, sha256f8a54e583a23fbdf048bd6e1c6842b96ad7689117cab4c8f404dcc6b6393929b(FrankenPHP v1.13.2 PHP 8.5.12 Caddy v2.11.7) - CPU: Intel Xeon Gold 6240R (Cascade Lake) in a VM; flags include avx2, avx512f/dq/cd/bw/vl/vnni, no sha_ni
- OS: Debian 12, kernel 6.1
- Works fine on a QEMU VM whose CPU exposes
sha_ni
Reproduce
./frankenphp php-cli -r 'echo strlen(hash("sha256", str_repeat("x", 100000)));'
# v1.13.2 → Illegal instruction (exit 132)
# v1.13.1 → 64
Other functions tested fine (base64, json, preg, mbstring, bin2hex, str_replace, explode, addslashes).
In worker mode (Laravel Octane) every PHP thread dies on the first request (audit log: comm="php-2" exe=".../frankenphp" sig=4), so the service crash-loops.
Expected
Runtime CPU detection (or a baseline x86-64 build) so the binary runs on CPUs without SHA-NI, as v1.13.1 did.
May be problem with StaticPHP 3.0.0-alpha1 and zig in Configure Command?
Build Type
Static binary
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
phpinfo() output
PHP Version => 8.5.12
System => Linux 6.1.0-41-amd64 (Debian 12) x86_64
Build Date => Oct 21 2026 18:49:13
Server API => PHP CLI embedded in FrankenPHP
Thread Safety => enabled
Zend Extension Build => API420250925,TS
Loaded Configuration File => (none)
Additional .ini files parsed => /etc/frankenphp.d/uploads.ini, /etc/frankenphp.d/zz-hardening.ini
Configure Command (relevant part):
'--enable-zts' '--disable-zend-signals' '--enable-zend-max-execution-timers'
'--enable-opcache-jit' 'php_cv_have_avx512=no' 'php_cv_have_avx512vbmi=no'
'PHP_BUILD_PROVIDER=StaticPHP 3.0.0-alpha1' 'PHP_BUILD_COMPILER=zig'
memory_limit => 128M
max_execution_time => 0
upload_max_filesize => 50M
post_max_size => 52M
session.upload_progress.enabled => Off
opcache.enable => On
opcache.enable_cli => Off
opcache.jit => disable
Extensions: Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, amqp, apcu, ast,
bcmath, brotli, bz2, calendar, ctype, curl, date, dba, deepclone, dom, exif, fileinfo,
filter, frankenphp-cli, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, intl, json,
ldap, lexbor, libxml, lz4, mbstring, memcached, msgpack, mysqli, mysqlnd, openssl,
parallel, pcntl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, protobuf, random,
readline, redis, session, shmop, soap, sockets, sodium, sqlite3, ssh2, standard, sysvmsg,
sysvsem, sysvshm, tidy, tokenizer, uri, xlswriter, xml, xmlreader, xmlwriter, xsl, xz,
yaml, zip, zlib, zstd
Activity
CHADREX commentedon Oct 21, 2026
Same problem:
Environment
Intel Xeon Processor (Cascadelake)(KVM VPS), avx2/avx512 present, nosha_nifrankenphp-linux-x86_64v1.13.2, sha256f8a54e583a23fbdf048bd6e1c6842b96ad7689117cab4c8f404dcc6b6393929bphp_serverWhat I saw
frankenphp php-cli -r 'hash("sha256","x");'exits with 132 (SIGILL);sha512,xxh3,crc32c,md5, openssl AES-GCM, sodium, bcrypt/argon2id are all fine.status=4/ILL) on the first request that toucheshash('sha256'), which in Laravel is nearly every page (cookie encryption / CSRF).frankenphp validatepasses and a trivial health endpoint (Laravel's/up) returns 200, so an automated "upgrade + health check" can pass before real traffic kills the server.Workaround
The
frankenphp-linux-x86_64-gnuasset of the same release (sha2565fdef42b73c19f8ff601edbde6f205836c0903bd3fb0ef807b8ae7fb088d9536) works fine on the same machine:hash('sha256')OK, same extension set (plusmsgpack), no crashes under real traffic withopcache.jit=tracing. So it seems limited to the musl/zig static build.rsantellan commentedon Oct 21, 2026
Same issue on a DigitalOcean droplet (different provider and CPU from the reports above):
Environment
DO-Regularsha_niand noavx512f(x86-64-v3, not v4)What I saw
frankenphp-linux-x86_64v1.13.2, the service crash-looped under real traffic:frankenphp.service: Main process exited, code=dumped, status=4/ILLWorkaround confirmed
The
frankenphp-linux-x86_64-gnuasset of v1.13.2 works on this machine and is now running in production without crashes.Since this CPU has no AVX-512 at all, it confirms the trigger is the missing SHA-NI check in the musl/zig build, not AVX-512. Given that 1.13.2 is the PHP2Shell fix, it may be worth pointing affected users to the
-gnuasset in the release notes until a fixed build is out.fix(deploy): install the glibc FrankenPHP build so 1.13.2 doesn't crash
jocheep commentedon Oct 21, 2026
Hit this too today, on a Google Cloud VM this time (not Cascade Lake).
lscpujust says "Intel(R) Xeon(R) CPU @ 2.20GHz". It has AVX2 but no AVX-512 and nosha_ni, Ubuntu 24.04.Upgraded to the v1.13.2
frankenphp-linux-x86_64binary,validatepassed, service came up fine... and about 10 seconds later it started dying withstatus=4/ILLon every restart until systemd gave up. Took down all our Laravel sites until I rolled back to 1.10.1.Same repro as above, just through a script file since
php-cli -rdoesn't work:The
-gnubuild from the same release works fine for us. It's been serving real traffic with no restarts since.So it's not just Cascade Lake, it looks like any CPU without SHA-NI. Might be worth a heads-up in the release notes, because
validateand a basic health check both pass before it blows up, so it's easy to miss.Agent: install FrankenPHP's glibc build (1.13.2's musl build SIGILLs …
pbranco-weezie commentedon Oct 22, 2026
Same crash on AWS EC2, Laravel Octane worker mode. One data point that may narrow it:
hash('sha256')So on our side a CPU without SHA-NI is not enough to trigger it; the AVX-512 host crashes and the AVX2-only one does not.
-gnu1.13.2 works on the 8259CL, but given #2744 it isn't a safe fleet-wide workaround on AVX2-only hosts.In production Octane restarted 20 to 25 times in 40 minutes on the busiest hosts;
/upstayed green because it sends no cookies, while any request with Laravel's encrypted cookies hits SHA-256. We are on a self-built 1.13.1 with PHP 8.4.27 (static-php-cli v2), which runs on both CPUs.PHP2Shell: patched PHP in the control plane and servers' FrankenPHP (#73
muteshi commentedon Oct 22, 2026
Same crash here (Xeon Gold 6230R, Cascade Lake, AVX-512 present, no
sha_ni, Ubuntu 24.04, Laravel Octane worker mode), with the faulting instruction from gdb:I think the cause is the default target in
build-static.shsince #2618:The middle
nativeis the CPU, so the release binary is compiled for the CI runner's CPU. The runner has SHA-NI and AVX-512, so the build usessha256rnds2in ext/hash without a runtime check, and AVX-512 elsewhere (#2744). That matches every report so far: hosts withoutsha_nicrash inhash('sha256'), and hosts without AVX-512 crash more widely.A generic CPU target for release builds (for example
x86_64-linux-musl, or an explicitx86_64_v2/v3baseline) should fix both. The-gnubuild probably needs the same baseline, since #2744 finds AVX-512 instructions in it too. I'm happy to open a PR if that direction is right.twispr commentedon Oct 22, 2026
Same here on a VPS reporting
Intel Core Processor (Haswell, no TSX). It supports x86-64-v3 (AVX2) but has no AVX-512 and nosha_ni. Ubuntu 24.04, Symfony 8.1, worker mode plus Symfony Messenger consumers. Same faulting instruction and address as above (sha256rnds2at0x7ffff2d90722). The web service kept crashing withstatus=4/ILLafter about 100 s, then about 20 s, under real traffic, and the Messenger consumers died within seconds.One more data point about the gnu workaround on hosts without AVX-512. The v1.13.2
frankenphp-linux-x86_64-gnuasset has been serving production traffic on this machine for more than two hours, through a reboot and a deploy, web and Messenger workers, without any SIGILL. So the AVX-512 instructions found in it (#2744) don't seem to be reached on this host, at least for a Symfony app.ramonmalcolm10 commentedon Oct 22, 2026
I think the root cause is in the build setup, not just the release assets. Since 1.13.2 moved to static-php-cli v3,
build-static.shdefaultsSPC_TARGETtonative-native-musl, so zig compiles the C side for whatever CPU the build machine has. The binary then picks up SHA-NI, BMI2 and AVX-512 with no runtime check, which matches thesha256rnds2faults above.The same thing happens to anyone who builds their own image with
build-static.sh, for example on top ofstatic-builder-musl. We hit it in our own base image: the binary hadsha256rnds2and zmm instructions in the C code from whichever CI runner built it.Setting
SPC_TARGET="$(uname -m)-linux-musl"(static-php-cli's own default) before runningbuild-static.shbuilds for the architecture baseline and fixes it for us. Defaulting to that for musl, or at least documentingSPC_TARGETin the script header, would fix the release binaries and third-party builds alike.fix(static): build musl binaries for the baseline CPU (php#2749)
hrojaswm commentedon Oct 23, 2026
Hi,
I'd like to ask about the current status of the fix for issue #2743 (SIGILL in hash('sha256') on CPUs without SHA-NI with the v1.13.2 static binary).
I understand that PR #2749 has already been merged into main, which fixes the root cause in the source code (changing SPC_TARGET so builds target the baseline CPU instead of the CI host). However, my concern is that the downloadable binary for the v1.13.2 release is still the original artifact, built before that fix.
My specific questions are:
Are you planning to publish a new official release (e.g., v1.13.3) that includes the static binary rebuilt with the PR #2749 fix?
If so, is there an estimated date for that release?
In the meantime, is there an official recommended alternative for those of us who need the PHP 8.5.12 security patch (PHP2Shell) but cannot use the current static binary due to the SIGILL regression? (I understand the -gnu asset works in some cases, but I've seen reports that it may have similar issues on CPUs without AVX-512.)
Thanks in advance for the clarification, since the difference between "fixed code in main" and "fixed binary published" is critical for planning the upgrade in production.
henderkes commentedon Oct 23, 2026
Don't use the static binary in production is the best advice we can give there, but that already applied before the CVEs.
GitHub auto closed the issue, but it will take a new release to go live.
fix(security): vuelve a FrankenPHP 1.13.1 (PHP 8.5.12) porque los bin…
fix(security): vuelve a FrankenPHP 1.13.1 (PHP 8.5.12) porque los bin…
fix(security): vuelve a FrankenPHP 1.13.1 (PHP 8.5.12) porque los bin…