I have website(PHP) hosted in a small business Yahoo and application(Java) hosted in Rackspace.
I do file_get_contentsfrom site to application. which works great in my local. but when I try to do the same after deploying it to the server, it will not work.
Here I make a request that sends a training list in format JSON.
PHP part
$trainingArrayJson = file_get_contents('http://mywebapplication.com/publicTraining/getTrainingsAsJson/');
$trainingArray = json_decode($trainingArrayJson);
-------
-----
this does not work.
if i do
$trainingArrayJson = file_get_contents('http://localhost:8080/publicTraining/getTrainingsAsJson/');
$trainingArray = json_decode($trainingArrayJson);
it works great.
source
share