PHP reading a page on my site -


I am trying to open a page to read a page on my own website, I work I am trying to do I have tried several ways to do this:
file_get_contents

  $ temp = file_get_contents ("http://www.mysite.com/example01/ "); Counter $ temp;  

Returns:

Warning: file_get_contents (http://www.mysite.com/example01/) [function.file-get-content]: Failed to open the stream: A connection attempt was unsuccessful because the connected party did not respond properly after a while, or the established connection failed because the failed host failed to respond. In C: \ inetpub \ wwwroot \ mysite \ example01 \ temp.php on line 66

curl

  function curl ( $ Url) {$ ch = curl_init ($ url); Curl_setopt ($ CH, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_HEADER, true); // display header curl_setopt ($ ch, CURLOPT_VERBOSE, true); // display communication with server curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); Print "& lt; Pre & gt; \ n"; Print_r (curl_getinfo ($ ch)); // error information "\ n \ ncURL error number:" .curl_errno ($ ch); // Print error information resonates "\ n \ ncURL error:". Curl_error ($ ch); Print "& lt; / pre & gt; \ n"; Return curl_exec ($ ch); Curl_close ($ ch); } $ Temp = curl ("http://www.mysite.com/example01/"); Echo "'$ temp'";  

returns:

array ([url] => [http_code] => 0 [header_image] => 0 [request_image] => 0 [filetime ] => 0 [ssl_verify_result] => 0 [all_time] => 0 [nameelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_upload] = Curl error number: 0

curl error: <0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0)

/ P>

''

The page takes approximately 30 seconds to reload.

The CURL is enabled in php.ini, and therefore is allow_url_fopen.

Can this be a firewall problem? I had a problem with a client some time ago, even though I was able to use the cURL or http stream cover to access external resources. I was told by hosting support that their firewall had defaulted outbound http requests from their servers by default and would need to add an exception to those sites that I was trying to access.

The first error message shows this as if you are running on your PC using IIS. Is there something in IIS config or your computer setup that is blocking the server accessing remote resources?


Comments