Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel makes FrankenPHP freeze and crash #308

Open
dunglas opened this issue Jun 24, 2024 · 10 comments
Open

parallel makes FrankenPHP freeze and crash #308

dunglas opened this issue Jun 24, 2024 · 10 comments

Comments

@dunglas
Copy link

dunglas commented Jun 24, 2024

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,

@skmirajbn
Copy link

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 :)

@realFlowControl
Copy link
Collaborator

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

@skmirajbn
Copy link

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.

@dunglas
Copy link
Author

dunglas commented Jul 5, 2024

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
Copy link
Author

dunglas commented Jul 5, 2024

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

@skmirajbn
Copy link

skmirajbn commented Jul 5, 2024

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.

@dunglas
Copy link
Author

dunglas commented Jul 8, 2024

@realFlowControl I wonder if you don't have the same issue as xdebug/xdebug#958

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

@skmirajbn
Copy link

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

@dunglas
Copy link
Author

dunglas commented Jul 8, 2024

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

@skmirajbn
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants