脚本宝典收集整理的这篇文章主要介绍了PHP’file_get_contents’在服务器上不起作用,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在从网站到应用程序创建一个file_get_contents.在我当地工作得很好.但是当我在服务器中部署它后尝试相同时不起作用.
在这里,我正在制作以JSON格式发送培训列表的arequest.
PHP部分
$trainingArrayJSON = file_get_contents('http://mywebapplication.COM/publicTraining/getTrainingsAsJson/'); $trainingArray = json_decode($trainingArrayJson); ------- -----
这不起作用.
如果我做
$trainingArrayJson = file_get_contents('http://localhost:8080/publicTraining/getTrainingsAsJson/'); $trainingArray = json_decode($trainingArrayJson);
这很好用.
以上是脚本宝典为你收集整理的PHP’file_get_contents’在服务器上不起作用全部内容,希望文章能够帮你解决PHP’file_get_contents’在服务器上不起作用所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。