-
Notifications
You must be signed in to change notification settings - Fork 55
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
Incorrect 'Command unexpectedly terminated' error message when proc_get_status is disabled via disable_functions #53
Comments
See #50. I don't want to add checks like this:
|
I respect your decision, however, I have a differing opinion. At least some users of the library will need this functionality (such as myself) and they all will need to re-implement this functionality outside of the library code and keep it updated as the library code changes. I would say that is an impetus for adding it to the library. It doesn't have to be on by default. It might be a simple function that would check compatibility and set Thanks for all the great work! |
I still disagree. We can't check for each and every thinkable PHP configuration and try to fix things. This is way out of the scope of this library and it will be hard to maintain this kind of checks over time (people will come up with all kinds of weird server configs and ask to fix things - when in fact it's their responsibility as a developer to ensure a well configured prod environment). |
I don't know if I buy that argument. Sometimes the developer doesn't control the production environment and would have to programmatically ensure it. Also, the developer that uses the library doesn't always know all these little details without doing an in-depth library code review. It is far easier for the developer of the library itself to know what is required of the environment. But this is up to you, thanks for looking into it. |
Hi,
I get a PHP warning that
proc_get_status() has been disabled for security reasons
on this one system. Apparently,proc_open
is allowed, but notproc_get_status
. I looked at the code and it looks like the call toproc_get_status
was added to solve issue #20.The thing is, I believe if
proc_get_status
is disabled, you get theCommand unexpectedly terminated without error message
even when the command is still running. I suggest changing the code at src/Command.php:431 to check ifproc_get_status()
is usable and/or check the contents of $status before using it and doing something else if the contents of$status
are invalid.I am sure there is a better solution that can be used. Maybe seeing if pipes are still open or setting
useExec
to true in such cases. MaybeuseExec
can be automatically set based on some checks?Any thoughts?
The text was updated successfully, but these errors were encountered: