Jump to content

get_file_contents() does not work for localhost


keenlearner

Recommended Posts

Hello, I have problem with file_get_contents() in my localhost.

When i try

echo file_get_contents('http://localhost/index.php'); // it output error of 


// but when i try 
echo file_get_contents('http://www.google.com/') // it works

 

my http://localhost/index.php just content a string "<h1> It works</h1>"

Does anybody know why ? I thought my firewall is blocking the connection, so when I disabled my firewall, it still not working. Thanks for any of your help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.