file_get_contents (" https://en.wikipedia.org/wiki/Main_Page "); Goes in timeout, "failed to open stream: Connection timed out in" The same query with curl_exec () works with a bang.

Somewhere server settings, perhaps after upgrading PCP, but where, can anyone have any ideas?

CentOS, PHP 5.6.30

  • So use a curl. Why reinvent the wheel? Does curl work? -Works. So that's great! :) - intro94

1 answer 1

It's just that on the Wikipedia server in the settings of allow_url_fopen = false, therefore, it’s impossible to read the data. For such purposes curl is used.