-
Notifications
You must be signed in to change notification settings - Fork 32
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
PHP exit;
fails to produce a CGI response
#24
Comments
I did some investigating today. This bug is related to the lack of Ruby has a working version of the I integrated the ruby code with php v7.4.32 and it seems to work well. I'd like to open a PR with the patch but I'm unsure how to produce the actual patch file from the build-staging directory. |
Hello @fd! Thank you for taking the time to investigate this issue. You are absolutely right, this issue is due to the fact of a missing setjmp/longjmp emulation. We are super interested in looking at your patch and integrating it! When you clone the repo locally, you can add your patch to https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/php/php-7.4.32/patches, and then from the root of the repo you should be able to build PHP by running You need docker or podman for this build to succeed. After it has been built, you can find the PHP artifact at |
In case you did your changes in
I'm looking forward to seeing what you did as we're working on enabling PHP 8 fibers via asyncify so this can be combined with your work to a better end. |
I prepared the patch here #28 |
When
exit;
is called and the headers have not yet been flushed the CGI response is completely empty.The issue seems to be that the shutdown procedures are not called on
exit;
.Reproduction
When I run the scripts with a native php-cgi binary it produces the expected CGI responses.
But when I run the
test-exit-flush-fail.php
withwasmtime
it fails to produce a CGI response.> wasmtime --mapdir=./::./ php-cgi -- test-exit-flush-fail.php
The text was updated successfully, but these errors were encountered: