Re: problem with file_get_contents
- From: "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 08 Jul 2009 12:29:09 +0200
deepeshgairola escribió:
On Jul 8, 1:54 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
deepeshgairola schreef:
Hi friends ,Hi,
i am trying to read some data using file_get_contents
i am getting a warning
Warning: file_get_contents(http://72.13.81.34:8000/16931.htm)
[function.file-get-contents]: failed to open stream: Connection
refused in /home/content/t/u/b/tubtub/html/test/index.php on line 29
when i use
$data = file_get_contents('http://72.13.81.34:8000/16931.htm');
But its working well when i use $data = file_get_contents('http://
google.com');
is this because of urlhttp://72.13.81.34:8000? what shall i do to
get this function work.
thankx & regards
I tested the same script on PHP5.2 running on XP/SP3, and it works just
fine.
It has probably to do with port 8000 somehow.
A few questions:
1) If you paste the url into a browserwindow, can you reach the site?
(On the same machine where PHP runs of course)
2) What OS are you using and which PHP version?
I am using PHP Version 5.2.8 but on a godaddy free hosting account .> This function works fine when i run it on my localhost.
>
> And yes the web page is accessible at http://72.13.81.34:8000/16931.htm
If it's a free hosting account, it's likely that allow_url_fopen is set to off. Run phpinfo() and check its value.
This is the url on my server http://tubtub.com/test/
where i am running this script.
<?php
$data = '';
$new_string = '';
$test = '';
// Getting all the data from the report generated and getting
statistics from report //
$data = file_get_contents('http://72.13.81.34:8000/16931.htm');
echo $data;
?>
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
.
- Follow-Ups:
- Re: problem with file_get_contents
- From: Erwin Moller
- Re: problem with file_get_contents
- References:
- problem with file_get_contents
- From: deepeshgairola
- Re: problem with file_get_contents
- From: Erwin Moller
- Re: problem with file_get_contents
- From: deepeshgairola
- problem with file_get_contents
- Prev by Date: Re: problem with file_get_contents
- Next by Date: Re: problem with file_get_contents
- Previous by thread: Re: problem with file_get_contents
- Next by thread: Re: problem with file_get_contents
- Index(es):
Relevant Pages
|