parallel icon indicating copy to clipboard operation
parallel copied to clipboard

parallel makes FrankenPHP freeze and crash

Open dunglas opened this issue 1 year ago • 10 comments

parallel is buggy when used with FrankenPHP, which requires a ZTS build.

Let me know if we can help fix these issues in any way.

Best regards,

dunglas avatar Jun 24 '24 10:06 dunglas

Great news. My company's Standalone Self Executable binary Laravel application is in production, having the freezing issue on docker. Hopefully, in the next update, it will be solved. Thanks a lot for your contribution. Excited to see :)

skmirajbn avatar Jun 24 '24 13:06 skmirajbn

Hey @dunglas 👋

I am not sure https://github.com/dunglas/frankenphp/issues/858 has anything todo with ext-parallel at all. @skmirajbn can you check on my comment at https://github.com/dunglas/frankenphp/issues/858#issuecomment-2210823647?

Kind regards Florian

realFlowControl avatar Jul 05 '24 12:07 realFlowControl

Hey @dunglas 👋

I am not sure dunglas/frankenphp#858 has anything todo with ext-parallel at all. @skmirajbn can you check on my comment at dunglas/frankenphp#858 (comment)?

Kind regards Florian

I was about to say that. But after trying version 1.2, the freeze problem seems fixed. I don't know why even after selecting the extensions removing parallel solves the issue. Maybe, the binary builder still including all the extensions.

skmirajbn avatar Jul 05 '24 12:07 skmirajbn

This is definitely related to parallel. I reproduced the issue locally and the simple fact of removing ext-parallel fixed the issue (adding back the extension recreates the problem).

dunglas avatar Jul 05 '24 12:07 dunglas

The latest version of FrankenPHP doesn't include parallel anymore, because of this issue. That's why you don't have the problem.

dunglas avatar Jul 05 '24 13:07 dunglas

image Here in the dockerfile, I didn't include the parallel, But that time got the freezing problem. When Dunglas said that the extension parallel created the freezing issue, I was a bit confused that even I didn't include the extension in this list why it is causing the issue. At the time 1.2.1 version is released without parallel. I tried that and I can see that the freezing problem is gone. As the problem is gone that's why I didn't ask this question. @realFlowControl may be talking about it.

skmirajbn avatar Jul 05 '24 13:07 skmirajbn

@realFlowControl I wonder if you don't have the same issue as https://github.com/xdebug/xdebug/pull/958

CG(function_table) should be used instead of EG(function_table).

dunglas avatar Jul 08 '24 15:07 dunglas

Off Topic: Do anyone know how to increase PHP max_execution_time for Self Contained Binary. By default I can see it only 30 sec. I can't find way to set it.

image

skmirajbn avatar Jul 08 '24 15:07 skmirajbn

Change the value in php.ini or by using set_time_limit()

dunglas avatar Jul 08 '24 15:07 dunglas

I used this Dockerfile to build the binary.

FROM --platform=linux/amd64 dunglas/frankenphp:static-builder as builder

# Copy your app
WORKDIR /go/src/app/dist/app
COPY ./src/. .

WORKDIR /go/src/app/
RUN EMBED=dist/app/ \
    FRANKENPHP_VERSION=1.2.1 \
    PHP_EXTENSIONS=mbstring,intl,pdo_mysql,gd \
    PHP_VERSION=8.1 \
    ./build-static.sh

FROM alpine:3.19.0

WORKDIR /app
    
COPY --from=builder /go/src/app/dist/frankenphp-linux-x86_64 dat
    
EXPOSE 80
    
CMD ["./dat", "php-server", "--root=public/"];

I don't have php.ini file. Is there any option here? Like as I selected PHP_VERSION etc...

skmirajbn avatar Jul 08 '24 16:07 skmirajbn