Take the 2-minute tour ×

I'm running a php site on localhost and i'm getting the following error.

Warning: file_get_contents(http://www.engadget.com/rss.xml) [function.file-get-contents]: failed to open stream: HTTP request failed! in C:\Program Files\xampp\htdocs\infohut\rss_read_class.php on line 26

but when i run the same hosted in a real server, it doesn't give any error.

Also note that my local pc is connecting through a proxy and when i tried from a different pc with a direct connection to internet, the problem is not there.

So my guess is it has something to do with the proxy.

I'm using xampp for windows installation with php 5.1.4 and Apache 2.2.2

I tried adding my proxy settings to php.ini as well using below



still couldn't figure is out. Please advise if i need to change any other settings or anything.


share|improve this question
possible duplicate of file_get_contents behind a proxy? –  xdazz Jul 1 '12 at 8:42

1 Answer 1

You should enable allow_url_fopen in your php.ini

share|improve this answer
this is enabled. as i mentioned it doesn't work only when i'm behind a proxy. –  Jude F'do Jul 1 '12 at 9:30

Your Answer


