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

file_get_contents fails to https if https-wrapper is not installed/allow_fopen_url is not set #136

Closed
DracoBlue opened this issue Nov 3, 2013 · 5 comments

Comments

@DracoBlue
Copy link

I spend some time to figure, why the client does not retrieve a valid response and failed with:

"file_get_contents(https:\/\/github.com\/login\/oauth\/access_token) [\u003Ca href=\u0027function.file-get-contents\u0027\u003Efunction.file-get-contents\u003C\/a\u003E]: failed to open stream: No such file or directory"

When I removed the error_reporting(0)-line in StreamClient.php it turned out, that the issue was a missing allow_furl_open + the https wrapper was not installed.

Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?

So I suggest to add a check (only in case of error) if the https wrapper is installed (like this http://stackoverflow.com/a/1975949/863954 ).

If you want I can prepare a pullrequest :).

@CMCDragonkai
Copy link
Contributor

Sure, also I think composer.json should note that it is required to have the open-ssl extension. Like

"ext-openssl"

I think that might work, try testing it.

@PeeHaa
Copy link
Collaborator

PeeHaa commented Nov 5, 2013

I think I would rather suggest it for more flexibility:

"suggest": {
    "ext/openssl": "*"
},

As a bonus I think it indeed is a good idea to handle the cases where the https-wrapper is not available considering we are simply eating errors.

Or it would be even better if we could just handle errors the right way ™ instead of simply killing errors.

@CMCDragonkai
Copy link
Contributor

I thinks its meant to be ext-openssl

@PeeHaa
Copy link
Collaborator

PeeHaa commented Nov 9, 2013

Yes it is :-)

@daviddesberg
Copy link
Owner

Added ext-openssl as a suggest, closing (bdc9021)

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

4 participants