Bug #74040 [Fbk->NoF]: file_get_contents not working anymore for adresses not on domain (timeout)
Edit report at https://bugs.php.net/bug.php?id=74040&edit=1
ID: 74040
Updated by: php-bugs@lists.php.net
Reported by: everdij at gmail dot com
Summary: file_get_contents not working anymore for adresses not
on domain (timeout)
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: *General Issues
PHP Version: 7.1.1
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2017-05-19 13:45:06] everdij at gmail dot com
[2017-05-14 18:44 UTC] ganlvtech at qq dot com
Tnx that is the solution
------------------------------------------------------------------------
[2017-05-14 18:44:14] ganlvtech at qq dot com
I tried your test script and got the following warning.
SSL routines:ssl3_get_server_certificate:certificate verify failed
<?php
error_reporting(E_ALL);
$file_contents = "https://google.nl";
$contextOptions = array(
'ssl' => array(
'verify_peer' => false,
)
);
$context = stream_context_create($contextOptions);
$body = file_get_contents($file_contents, 0, $context);
var_dump($body);
?>
If I set verify_peer to false, it works.
------------------------------------------------------------------------
[2017-02-04 16:08:42] rasmus@php.net
That's still not enough details. Your example works for us. Try it on a different server. This
is most likely a local network configuration issue. Like a firewall blocking outbound http requests.
------------------------------------------------------------------------
[2017-02-04 12:06:09] everdij at gmail dot com
Not working (gives time out)
$file_contents = "https://google.nl";
$body = file_get_contents($file_contents);
var_dump($body);
Not working gives timeout
$file_contents = "https://google.nl";
$body = file_get_contents($file_contents,null,null,null,null);
var_dump($body);
Works
$file_contents = "../local_file.txt";
$body = file_get_contents($file_contents);
var_dump($body);
Curl works! so looks like nothing to do with network setup
------------------------------------------------------------------------
[2017-02-03 15:07:44] requinix@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Make sure it's not a problem with your network configuration.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=74040
--
Edit this bug report at https://bugs.php.net/bug.php?id=74040&edit=1
Thread (8 messages)