I have a simple code:
$t = file_get_contents("http://sub.example.com/list?u=test&passw=12345");
If I print that result I get "Application Error" text.
I really don't understand the reason, if I try to open that url on the browser i see it perfectly.
It returns "application/json" data.
It is possible that the web application at sub.example.com
expects some additional input apart from what goes into the URL (e.g. a cookie), does not find this input, and errors out.
In any case, it's certain that the HTTP requests generated by (a) your program and (b) your browser are not identical, otherwise the application would exhibit the same behavior in both cases.
To debug this, you can do the following:
cURL
instead of file_get_contents
, so that you can specify an HTTP proxy