2012-03-14 70 views
0

当我测试我的代码在localhost(即代码和web服务是本地),那么一切工作正常,但当我们移动代码到服务器我没有从web服务获取数据。Web服务不提取数据

以下消息发生。 无法打开流:HTTP请求失败! HTTP/1.0 404未找到。

<?php $Name=file_get_contents('web service call'); 

$output= json_decode($Name); 

?> 

回答

0

该错误表示找不到file_get_contents()调用的URL。

当您将代码移至服务器时,您是否也移动了“Web服务”?如果位置已更改,则需要在file_get_contents()呼叫中更新它。

+0

是我移动webservice ....我的JavaScript web服务正在工作,但从PHP ...不工作 – rash111 2012-03-14 12:18:37

+0

显示工作的JavaScript代码 – MrCode 2012-03-14 12:32:40