keenlearner Posted April 3, 2007 Share Posted April 3, 2007 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. Link to comment https://forums.phpfreaks.com/topic/45428-get_file_contents-does-not-work-for-localhost/ Share on other sites More sharing options...
ted_chou12 Posted April 3, 2007 Share Posted April 3, 2007 try just echo file_get_contents('index.php'); I believe that should work. Ted Link to comment https://forums.phpfreaks.com/topic/45428-get_file_contents-does-not-work-for-localhost/#findComment-220577 Share on other sites More sharing options...
keenlearner Posted April 3, 2007 Author Share Posted April 3, 2007 Yeah...so happy I am, why I had not thought of trying that. Thanks so much, i figure out this problem from morning till now. Thanks. Link to comment https://forums.phpfreaks.com/topic/45428-get_file_contents-does-not-work-for-localhost/#findComment-220580 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.