Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php文件_get_内容在linux托管asmx链接时不起作用_Php_Linux_Web Services_Webserver_Hosting - Fatal编程技术网

php文件_get_内容在linux托管asmx链接时不起作用

php文件_get_内容在linux托管asmx链接时不起作用,php,linux,web-services,webserver,hosting,Php,Linux,Web Services,Webserver,Hosting,我的代码如下: $CheckingLink="http://1.2.3.4:8080/abc.asmx/GetStatus?MobileNo=$MobileNO"; $CheckStatus=file_get_contents($CheckingLink); if($CheckStatus==1) return true; 它在我的本地PC中正常工作,返回值为1。 但是,当我将相同的代码上传到我的linux主机时,链接没有返回任何内容。 另一方面,如果我尝试任何像“http://1.2.3

我的代码如下:

$CheckingLink="http://1.2.3.4:8080/abc.asmx/GetStatus?MobileNo=$MobileNO";
$CheckStatus=file_get_contents($CheckingLink);
if($CheckStatus==1)
  return true;
它在我的本地PC中正常工作,返回值为1。 但是,当我将相同的代码上传到我的linux主机时,链接没有返回任何内容。 另一方面,如果我尝试任何像“
http://1.2.3.4:8080/abc.php?MobileNo=$MobileNO
” 它在我的电脑和主机上都正常工作

我的电脑和主机配置参数如下:

$CheckingLink="http://1.2.3.4:8080/abc.asmx/GetStatus?MobileNo=$MobileNO";
$CheckStatus=file_get_contents($CheckingLink);
if($CheckStatus==1)
  return true;
我的电脑:

OS: Winwods8
Webserver: IIS8
PHP version: 5.4.24
托管服务器:

OS: Linux
Webserver: apache 2.2.29
PHP Version: 5.2.17

在互联网上搜索时没有得到任何解决方案。等待正确的解决方案。

将'allow\u url\u fopen'参数的值检查到php.ini中。 如果'allow_url_fopen'的值为false或0,则它将不允许您将file_get_内容与url一起使用


您可以在php.ini中设置'allow\u url\u fopen=1'的值。

我没有访问主机php.ini的权限。还有其他方法吗?在测试文件上打印phpinfo()并检查输出是的,您可以使用以下方法:-ini\u set('allow\u url\u fopen',1)我已经设置了ini\u set。但没有改善。和以前一样。