Re: problem with file_get_contents

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 ,
i am trying to read some data using file_get_contents
i am getting a warning
Warning: file_get_contents(
[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('');
But its working well when i use $data = file_get_contents('http://');
is this because of urlhttp:// 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
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

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

where i am running this script.


$data = '';

$new_string = '';

$test = '';

// Getting all the data from the report generated and getting
statistics from report //

$data = file_get_contents('');

echo $data;


-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor satinado:

Relevant Pages