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 not work with https #193
Comments
file_get_contents should work with https URLs as long as you have the openssl extension (and that it has the proper configuration for its CA file). |
file_get_contents(https://i.ytimg.com/vi/Tj75Arhq5ho/hqdefault.jpg): failed to open stream: operation failed but if I try to use file_get_contents(http://i.ytimg.com/vi/Tj75Arhq5ho/hqdefault.jpg) it works |
There is a related issue opened in sonata-media: sonata-project/SonataMediaBundle#759 |
I found out the related issue. The capath must be set. See sonata-project/SonataMediaBundle#759 (comment) |
I used a different client and that was a easy workaround for me. Curl is a bit better in such things. $browser = new Browser();
$browser->setClient(new Curl()); Hope that helps some other guys too. |
Hi, I tried to use file_get_contents(http://www.xyz.com/health/121.json) still it does not works. Please help |
Thank you @rande for explaining the problem and thanks @markusguenther for a workaround. @poizon001, please see previous answers. |
Hello,
i'm using sonata-media for symfony and it uses Buzz for downloading some files (for example, thumbnails images from youtube).
Youtube is now using https as default, and it makes file_get_contents crash.
The problem is in /lib/Buzz/Client/FileGetContents.php line 60
adding this line before:
$url = str_replace("https", "http", $url);
should fix this, but I don't know if its the better solution.
The text was updated successfully, but these errors were encountered: