VPS侦探论坛

标题: lnmpa上的file_get_contents有问题不支持Authorization [打印本页]

作者: sbmzhcn    时间: 2012-5-28 16:44
标题: lnmpa上的file_get_contents有问题不支持Authorization
我的VPS

http://173.224.220.90/p.php
http://173.224.220.90/phpinfo.php

Centos5.8的photovps, 我想和主机应该没关系,只要是用一键安装包的话,就不行。

在一般情况下都能用它打开远程URL, 但如果打开需要密码验证的网站,在lnmpa的服务器上就不行。但是其它的VPS倒是可以。请问 lnmpa对它做了什么限制吗,为什么不能用呢。

部分代码
  1. $context = stream_context_create(array(
  2.                                                         'http' => array(
  3.                                                                 //'proxy' => 'tcp://127.0.0.1:8888',
  4.                                                                 'request_fulluri' => true,
  5.                                                                 'header'  => "Authorization: Basic " . base64_encode($accountKey . ":" . $accountKey),
  6.                                                                 'timeout'=>60
  7.                                                         )
  8.        
  9.                                 ));
  10.                                 $request = $WebSearchURL . urlencode( '\'' . $query . '\'');
  11.                                 //echo($request);
  12.                                 //$request = "http://www.google.com";
  13.                                 $response = file_get_contents($request, 0, $context);
复制代码

作者: licess    时间: 2012-5-28 18:05
0.9是禁用了部分函数的,去掉禁用函数再试试
作者: sbmzhcn    时间: 2012-5-28 18:20
哪些被禁用了呢。到哪儿看,谢谢
作者: sbmzhcn    时间: 2012-5-28 18:50
被禁用的函数取消了,还是不行,看来就是不行啊。不知道原因。




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4