I need to make GET/POST requests to php API in subfolder (public/forum/api.php), e.g. not url from routes table.
file_get_contents() doesn't work on localhost for some reason on dev server (port 8000).
// this keeps loading without result
$response = file_get_contents('http://localhost:8000/forum/api.php');
// these works fine
$response = file_get_contents('http://localhost'); // apache index without port
$response = file_get_contents('http://google.com'); // remote call
Navigating in borwser to http://localhost:8000/forum/api.php works fine.
Same results for curl calls.. Any ideas why requests from php to port 8000 freeze? Is there any other way?
Thanks
Maybe it has something to do with the fact that localhost:8000 is served by the php built in server ?
Most probably, but I can't find a way around it.
Ok, I solved it. I wrote about it here http://stackoverflow.com/a/25651196/916682
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community