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对它做了什么限制吗,为什么不能用呢。
部分代码
$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);
复制代码
作者:
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