mickey78
November 12th, 2008, 02:34 PM
Hello guys.
I have a server running ubuntu 7.10
Most of the things on it are running smoothly.
I have this problem that makes me bang my head.
I am running a php script, that tries to open a file from the local server, and it gives me a connection refused problem. I have tried EVERYTHING i could think of, and it doesnt work.
So I reduced it to something VERRRRY basic, and still gives me the error. Here is the details
<?php
$file = fopen('http://www.mydomain.com/myfile.txt', 'r');
?>
And this simple thing gives me:
Warning: fopen(http://www.mydomain.com/myfile.txt) [function.fopen]: failed to open stream: Connection refused in /var/www/script.php on line 10
Now off course, my real script isnt something like that, but I wanted to make it very simple to eliminate all the sources.
Also, I can open the file in my browser no problem there.
I can fopen any other URL from any other server, but everytime i try to fopen a localfile, i get this.
Any help would be VERY appreciated!
Thanks a lot
I have a server running ubuntu 7.10
Most of the things on it are running smoothly.
I have this problem that makes me bang my head.
I am running a php script, that tries to open a file from the local server, and it gives me a connection refused problem. I have tried EVERYTHING i could think of, and it doesnt work.
So I reduced it to something VERRRRY basic, and still gives me the error. Here is the details
<?php
$file = fopen('http://www.mydomain.com/myfile.txt', 'r');
?>
And this simple thing gives me:
Warning: fopen(http://www.mydomain.com/myfile.txt) [function.fopen]: failed to open stream: Connection refused in /var/www/script.php on line 10
Now off course, my real script isnt something like that, but I wanted to make it very simple to eliminate all the sources.
Also, I can open the file in my browser no problem there.
I can fopen any other URL from any other server, but everytime i try to fopen a localfile, i get this.
Any help would be VERY appreciated!
Thanks a lot