Description
On linux/riscv64, the official php:8.3-alpine image crashes with exit code 139 (SIGSEGV) when running PECL/PEAR commands that contact remote channels (e.g. pecl install, pear list-channels, pecl list-channels).
Local-only PEAR commands such as pear version and pear list work fine.
This blocks the documented workflow of installing PHP extensions via pecl install on riscv64, including multi-arch image builds that use docker buildx with QEMU emulation for linux/riscv64.
Environment
|
|
| Image |
php:8.3-alpine3.24 |
| PHP |
8.3.33 (cli) NTS |
| PEAR |
1.10.18 |
| Platform |
linux/riscv64 (also reproduced under QEMU via Docker Desktop on macOS) |
| OpenSSL |
3.5.7 |
Steps to reproduce
docker run --rm --platform linux/riscv64 php:8.3-alpine3.24 sh -euxc '
apk add --no-cache $PHPIZE_DEPS
pecl install igbinary
'
Also fails without any build deps:
docker run --rm --platform linux/riscv64 php:8.3-alpine3.24 pear list-channels
Actual result
Exit code: 139
Expected result
pecl install should download and build the extension, as it does on other PHP versions and architectures.
Scope (tested)
| PHP version |
linux/riscv64 pecl install igbinary |
| 8.2-alpine3.24 |
works |
| 8.3-alpine3.24 |
segfault |
| 8.4-alpine3.24 |
works |
| 8.5-alpine3.24 |
works |
| Platform |
php:8.3-alpine3.24 pecl install igbinary |
| linux/amd64 |
works |
| linux/arm64 |
works |
| linux/ppc64le |
works |
| linux/s390x |
works |
| linux/riscv64 |
segfault |
Commands that work on php:8.3-alpine / riscv64:
pear version
pear list
php /usr/local/lib/php/pearcmd.php (help output)
Commands that segfault:
pecl install <package>
pear list-channels
pecl list-channels
pecl search <package>
The crash appears tied to PEAR network/channel operations, not extension compilation.
Real-world impact
Any Dockerfile using pecl install fails when building for linux/riscv64 with PHP 8.3:
FROM php:8.3-alpine
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install igbinary redis swoole \
&& docker-php-ext-enable igbinary redis swoole
Example from a multi-arch base image build:
+ LDFLAGS=-lucontext pecl install igbinary redis swoole ssh2
Segmentation fault
ERROR: exit code: 139
Additional context
register_argc_argv=On and other flags from the pecl wrapper script do not change the outcome.
- Adding
libucontext / LDFLAGS="-lucontext" does not fix the segfault (that is a separate build concern on some architectures for extensions like swoole).
- PHP 8.3 on riscv64 is otherwise functional (
php -v, php -m, docker-php-ext-install from local source work).
Description
On
linux/riscv64, the officialphp:8.3-alpineimage crashes with exit code 139 (SIGSEGV) when running PECL/PEAR commands that contact remote channels (e.g.pecl install,pear list-channels,pecl list-channels).Local-only PEAR commands such as
pear versionandpear listwork fine.This blocks the documented workflow of installing PHP extensions via
pecl installon riscv64, including multi-arch image builds that usedocker buildxwith QEMU emulation forlinux/riscv64.Environment
php:8.3-alpine3.24linux/riscv64(also reproduced under QEMU via Docker Desktop on macOS)Steps to reproduce
Also fails without any build deps:
Actual result
Exit code: 139
Expected result
pecl installshould download and build the extension, as it does on other PHP versions and architectures.Scope (tested)
linux/riscv64pecl install igbinaryphp:8.3-alpine3.24pecl install igbinaryCommands that work on
php:8.3-alpine/ riscv64:pear versionpear listphp /usr/local/lib/php/pearcmd.php(help output)Commands that segfault:
pecl install <package>pear list-channelspecl list-channelspecl search <package>The crash appears tied to PEAR network/channel operations, not extension compilation.
Real-world impact
Any Dockerfile using
pecl installfails when building forlinux/riscv64with PHP 8.3:Example from a multi-arch base image build:
Additional context
register_argc_argv=Onand other flags from thepeclwrapper script do not change the outcome.libucontext/LDFLAGS="-lucontext"does not fix the segfault (that is a separate build concern on some architectures for extensions like swoole).php -v,php -m,docker-php-ext-installfrom local source work).