When I request a localhost page via file_get_content(),I got this warning while other http target it's ok, like http://google.com, anyone could help? thanks a bunch:)
Warning: file_get_contents(http://127.0.0.1/t/api/uc.php?s=UIEIRQb ... SR0DN9Q%3D) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in D:\xampplite\htdocs\t\login.php on line 162
both 127.0.0.1 and localhost is malfunctioned.
Plus: the local url is working fine when I check it with my firefox.
file_get_contents won't work with target of localhost
Moderator: General Moderators
Re: file_get_contents won't work with target of localhost
I just tried
and with localhost too and they both worked for me!
So it's most likely a problem with your specific set up, rather than a general PHP problem.
Code: Select all
$hehe=file_get_contents('http://127.0.0.1');
print $hehe;
and with localhost too and they both worked for me!
So it's most likely a problem with your specific set up, rather than a general PHP problem.
Re: file_get_contents won't work with target of localhost
http://127.0.0.1/t/api/uc.php?s=UIEIRQb ... SR0DN9Q%3D this page not exist or it send header
Attentively see a code uc.php
Code: Select all
404 Not Found