There are 2 servers. One chief, the other mediator. The task is as follows: The main server wants to receive content from another site through an intermediary server, that is, by proxying.

The main server sends a GET request:

file_get_contents('http://сервер_посредник?url=http://someurl') 

The proxy server opens the requested link and sends the content:

 echo file_get_contents($_GET['url']) 

The fact is that when accessing an intermediary server through a browser, the required content from http: // someurl is displayed. And when accessing through the main server, there is a long wait, and then just time out. I tried to put on the mediation server just echo 'test123' to make sure that the mediation server is available for the main server. As a result, the main server receives output from echo , and as soon as I add file_get_contents , a long wait.

  • So maybe there is no network between them? Any wget/curl with the same URL running from the server? - vp_arth
  • php.net/manual/en/... is it included in php.ini? - Anton Zikov
  • wget shakes, curl loads endlessly. echo 'test123' after all receives, exactly when I add file_get_contents , it does not load anything. - Max_Payne
  • @AntonZikov on - Max_Payne
  • Try the final URL on the main server via urlencode () - Anton Zikov

0