PHP reading a page on my site -
PHP reading a page on my site -
i'm trying open read page on own website search engine i'm trying working. i've tried several ways of doing it: file_get_contents
$temp = file_get_contents("http://www.mysite.com/example01/"); echo $temp; returns:
warning: file_get_contents(http://www.mysite.com/example01/) [function.file-get-contents]: failed open stream: connection effort failed because connected party did not respond after period of time, or established connection failed because connected host has failed 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 headers curl_setopt($ch, curlopt_verbose, true); // display communication server curl_setopt($ch, curlopt_returntransfer, true); print "<pre>\n"; print_r(curl_getinfo($ch)); // error info echo "\n\ncurl error number:" .curl_errno($ch); // print error info echo "\n\ncurl error:" . curl_error($ch); print "</pre>\n"; homecoming curl_exec($ch); curl_close($ch); } $temp = curl("http://www.mysite.com/example01/"); echo "'$temp'"; returns:
array ( [url] => http://www.jlwarranty.com/example01/ [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => 0 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0 [redirect_time] => 0 )
curl error number:0
curl error:
''
it takes 30 seconds page reload.
curl enabled in php.ini, , allow_url_fopen.
could firewall issue? had issue while ago client unable utilize curl or http stream wrapper access external resource, despite both beingness enabled. told hosting back upwards firewall barred outbound http requests servers default , need add together exception site trying access.
from first error message looks if you're running on own pc using iis. there in iis config or computers setup stopping server accessing remote resources?
php
Comments
Post a Comment