laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.78k stars 296 forks source link

Your FrankenPHP binary version (1.0.3) may be incompatible with Octane #928

Open tebbbb opened 4 months ago

tebbbb commented 4 months ago

Octane Version

1.0.3

Laravel Version

11.8.0

PHP Version

8.3

What server type are you using?

FrankenPHP

Server Version

1.0.3

Database Driver & Version

No response

Description

Using the latest laravel version as of today.

WARN Your FrankenPHP binary version (1.0.3) may be incompatible with Octane.

Using FROM dunglas/frankenphp:1.0-php8.3

FROM dunglas/frankenphp:1.0-php8.3

ARG DOCKER_WWWGROUP
ARG DOCKER_WWWUSER
ARG NODE_VERSION=20
ARG APP_ENV

WORKDIR /var/www/html

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC

# Set timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Update and install essential packages
RUN apt-get -y update --fix-missing && \
    apt-get upgrade -y && \
    apt-get install -y --no-install-recommends \
        apt-utils \
        apt-transport-https \
        curl \
        wget \
        nano \
        dialog \
        build-essential \
        git \
        gnupg2 \
        iputils-ping \
        libonig-dev \
        libsqlite3-dev \
        libsqlite3-0 \
        libzip-dev \
        libicu-dev \
        libxml2-dev \
        libxslt-dev \
        libssh2-1-dev \
        libssh2-1 \
        libcurl4-openssl-dev \
        pkg-config \
        openssl \
        zip \
        unzip \
        supervisor && \
    rm -rf /var/lib/apt/lists/*

# Install Node.js and Yarn
RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - && \
    apt-get install -y --no-install-recommends nodejs && \
    npm install --global yarn && \
    rm -rf /var/lib/apt/lists/*

RUN pecl install xdebug

# Install PHP extensions
RUN install-php-extensions \
    pdo_sqlite \
    curl \
    zip \
    intl \
    mbstring \
    gettext \
    calendar \
    exif \
    pcntl \
    dom \
    xsl \
    simplexml \
    bcmath \
    sockets

# Clean up the image
RUN apt-get clean && apt-get autoremove -y

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Create user and group
RUN groupadd --gid 1000 $DOCKER_WWWGROUP && \
    useradd --uid 1000 --gid 1000 -m $DOCKER_WWWUSER && \
    chown 1000:1000 /var/log -R && chown 1000:1000 /var/run/ -R

# Switch to the new user
USER $DOCKER_WWWUSER

# Set the command to run frankenphp
ENTRYPOINT ["php", "artisan", "octane:frankenphp"]

Steps To Reproduce

see above

tebbbb commented 4 months ago

fixed it myself by using FROM dunglas/frankenphp:1.2.2-php8.3.9, but xdebug doesnt seem to work. Do i need to change anything for it to work? I can see it being enabled in phpinfo and the modes are also correct. Works with apache, just not with frankenphp

[xdebug]
xdebug.mode = debug,develop
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
xdebug.client_port = 9003
driesvints commented 4 months ago

@dunglas what's needed here?

dunglas commented 4 months ago

This seems to be the same issue as https://github.com/dunglas/frankenphp/issues/931#issuecomment-2243912889

Maybe should we add a special flag for XDebug?

driesvints commented 4 months ago

@dunglas I'm not sure about the specifics needed for Octane but anything to above the above issue is welcome yeah.

dunglas commented 4 months ago

Basically, we have to disable the worker mode and run in "normal" (CGI-like) mode when using Xdebug.

A feature that will allow us to use the worker mode with Xdebug is being developed by Xdebug, but in the meantime, it could be nice to add a flag to disable the worker mode. Something like artisan frankenphp:start --xdebug or --no-worker?