I have the strangest issue ever. I'm trying to get results of CGI script running on the same server with get_file_contents
and it works everywhere except my local machine under Ubuntu.
It works when I ask it to get url from different server (same script running on production), it works deployed on different server, I'm absolutely sure I have allow_url_fopen
set. But every time I'm trying to get that page from a local server I get failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
on PHP side and [error] [client 127.0.0.1] request failed: error reading the headers
in Apache error log.
So what can I do with it, what headers should I pass so Apache won't turn me down or, alternatively, what configuration options should I tweak for the same results?