lnmpa上的file_get_contents有问题不支持Authorization
我的VPShttp://173.224.220.90/p.php
http://173.224.220.90/phpinfo.php
Centos5.8的photovps, 我想和主机应该没关系,只要是用一键安装包的话,就不行。
在一般情况下都能用它打开远程URL, 但如果打开需要密码验证的网站,在lnmpa的服务器上就不行。但是其它的VPS倒是可以。请问 lnmpa对它做了什么限制吗,为什么不能用呢。
部分代码$context = stream_context_create(array(
'http' => array(
//'proxy' => 'tcp://127.0.0.1:8888',
'request_fulluri' => true,
'header'=> "Authorization: Basic " . base64_encode($accountKey . ":" . $accountKey),
'timeout'=>60
)
));
$request = $WebSearchURL . urlencode( '\'' . $query . '\'');
//echo($request);
//$request = "http://www.google.com";
$response = file_get_contents($request, 0, $context); 0.9是禁用了部分函数的,去掉禁用函数再试试 哪些被禁用了呢。到哪儿看,谢谢 被禁用的函数取消了,还是不行,看来就是不行啊。不知道原因。
页:
[1]