I'm having an issue with PhP where it times out when doing anything like
file_get_contents("http://127.0.0.1/test.php")
I've also tried using CURL and stuff, it works fine when I'm trying to recieve data from somewhere else, but when it's local host I get a 504.
I'm on Windows 10 x64 Php version is 7.0.18 nginx version is 1.8.0
So far I've tried settings permissions for all the directories, I've tried different user-agents etc, I've even tried replicating the same request as my chrome does in the browser, but I'm out of luck.
I get this nginx error in error.log.
2017/05/04 10:26:33 [error] 7732#5384: *5 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: _, request: "GET /test.php HTTP/1.0", upstream: "fastcgi://[::1]:9123", host: "127.0.0.1"
This is what I get from my access.log.
127.0.0.1 - - [04/May/2017:10:25:33 +0200] "GET /indexsss.php HTTP/1.1" 504 584 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36"
127.0.0.1 - - [04/May/2017:10:25:33 +0200] "GET /favicon.ico HTTP/1.1" 404 570 "http://127.0.0.1/indexsss.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36"
127.0.0.1 - - [04/May/2017:10:26:33 +0200] "GET /test.php HTTP/1.0" 504 182 "-" "PHP"
This is the php errors i get from php_errors.log
[04-May-2017 10:26:33 Europe/Copenhagen] PHP Warning: file_get_contents(http://127.0.0.1/test.php): failed to open stream: HTTP request failed! in C:\Servers\nginx-1.8.0\html\local\indexsss.php on line 208
[04-May-2017 10:26:33 Europe/Copenhagen] PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\Servers\nginx-1.8.0\html\local\indexsss.php on line 208
http://127.0.0.1/test.php is working fine when using the browser to access it. So I'm pretty clueless, I hope someone can help me out.
indexsss.php containts lots of commented code(Hence the line number of execution) The only uncommented code is this.
$test = file_get_contents("http://127.0.0.1/test.php");
test.php
"Hello, this is a test"
Let me know if you need more info.