简体   繁体   English

Wowza Server上的PHP脚本无法进行HTTP身份验证?

[英]HTTP Authentication fails from PHP script on Wowza Server?

Is there a configuration/setting for the Wowza server that must be correct to allow HTTP Authentication? Wowza服务器的配置/设置是否必须正确以允许HTTP身份验证?

According to How to get realtime connection counts from Wowza Media Server , I should be able to get some XML information that I need. 根据如何从Wowza Media Server获取实时连接数 ,我应该能够获得一些我需要的XML信息。 If I go to the url from a browser, it prompts for username/password, and I get the data, but if I try to accomplish it from PHP it fails no matter what method I use: 如果我从浏览器转到url,它会提示输入用户名/密码,我会得到数据,但是如果我尝试从PHP完成它,无论我使用什么方法,它都会失败:

HTTP request failed! HTTP/1.0 401 Unauthorized

Method #1: 方法#1:

$data = file_get_contents('http://admin:password@123.123.123.123:8086/connectioncounts');

Method #2 : 方法#2

$handle = fopen('http://admin:password@123.123.123.123:8086/connectioncounts', "r") 

Method #3 : 方法#3

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, http://123.123.123.123:8086/connectioncounts);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "admin:password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);

尝试将CURLAUTH_BASIC更改为CURLAUTH_ANY

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM