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

Usage within FPM #35

Closed
mpociot opened this issue Dec 9, 2020 · 2 comments
Closed

Usage within FPM #35

mpociot opened this issue Dec 9, 2020 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed new feature New feature or request
Milestone

Comments

@mpociot
Copy link

mpociot commented Dec 9, 2020

I'm using this package in a package of mine, where I need to access the SQLite database within a ReactPHP process, as well as within a standard synchronous request/response lifecycle.
Since I want to reuse the class that holds the database logic, I would like to use this package for both ways.

This is working fine, in general, as I am using your block/await function inside of the synchronous request/response.
The problem with this approach is, that since my web requests are running through php-fpm, the exec command is using the wrong binary - because PHP_BINARY returns FPM.

It would be great to have a setter for the PHP binary so that I could manually overwrite the binary for the synchronous process while maintaining the auto-detection logic within ReactPHP.

Is this something that I should PR?

@clue clue added bug Something isn't working new feature New feature or request help wanted Extra attention is needed labels Dec 9, 2020
@clue
Copy link
Owner

clue commented Dec 9, 2020

@mpociot Thanks for reporting, this actually sounds like both a bug and a new feature candidate!

This project should work when executed from PHP-FPM without requiring any special configuration. We already have a similar code path to avoid launching the CGI binary, so we should probably add similar logic to never invoke the PHP-FPM binary. Accordingly, the implementation shouldn't be too hard. Providing a reproducible test case might be more difficult though.

Additionally, it might be useful to provide a way to configure the PHP binary. I consider this to be advanced usage that should be documented as such.

PRs are very much welcome! :shipit:

@clue
Copy link
Owner

clue commented Nov 12, 2021

@mpociot Good news!

Expect this to be shipped with the next tagged release soon :shipit:

@clue clue closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants