dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.87k stars 235 forks source link

Segmentation fault /usr/local/bin/frankenphp php-cli ${args[@]} #968

Closed masterbater closed 2 months ago

masterbater commented 2 months ago

What happened?

Applied the php workaround

#!/usr/bin/env bash
args=("$@")
index=0
for i in "$@"
do
    if [ "$i" == "-d" ]; then
        unset 'args[$index]'
        unset 'args[$index+1]'
    fi
    index=$((index+1))
done

/usr/local/bin/frankenphp php-cli ${args[@]}

Run the queue, dispatch a job


sail artisan queue:work

It processes listeners but somehow got stopped and throw error

image

Rerunning again will continue to pickup the queued jobs then after a while it then throw that error again

Build Type

Docker (Debian Bookworm)

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

Docker configuration

FROM dunglas/frankenphp:latest-builder AS builder

# Copy xcaddy in the builder image
COPY --from=caddy:builder /usr/bin/xcaddy /usr/bin/xcaddy

# CGO must be enabled to build FrankenPHP
ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'"
RUN xcaddy build \
    --output /usr/local/bin/frankenphp \
    --with github.com/dunglas/frankenphp=./ \
    --with github.com/dunglas/frankenphp/caddy=./caddy/ \
    # Mercure and Vulcain are included in the official build, but feel free to remove them
    --with github.com/dunglas/caddy-cbrotli \
    # --with github.com/dunglas/mercure/caddy \
    # --with github.com/dunglas/vulcain/caddy \
    # Add extra Caddy modules here
    --with github.com/pberkel/caddy-storage-redis

FROM dunglas/frankenphp AS runner

ARG WWWGROUP
ENV TZ=UTC
ENV COMPOSER_ALLOW_SUPERUSER=1
# Replace the official binary by the one contained your custom modules
COPY --from=builder /usr/local/bin/frankenphp /usr/local/bin/frankenphp

# add additional extensions here:
RUN install-php-extensions \
    gd \
    intl \
    zip \
    opcache \
    mongodb \
    uv \
    pcntl\
    @composer \
    excimer \
    pgsql \
    pdo_pgsql \
    exif \
    redis \
    xdebug

COPY phpworkaround /usr/local/bin/php
RUN chmod +x /usr/local/bin/php
ENV PHP_BINARY=/usr/local/bin/php

RUN setcap "cap_net_bind_service=+ep" /usr/local/bin/frankenphp
RUN groupadd --force -g $WWWGROUP sail
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail

RUN usermod -u 1000 sail

Relevant log output

No response

masterbater commented 2 months ago

Closing this since its clarified

https://github.com/dunglas/frankenphp/issues/871#issuecomment-2284158725