Wowza服务器上的PHP脚本无法通过HTTP身份验证?
作者:互联网
Wowza服务器是否有必须正确才能进行HTTP身份验证的配置/设置?
根据How to get realtime connection counts from Wowza Media Server,我应该能够获得一些所需的XML信息.如果我从浏览器访问url,则提示输入用户名/密码,然后获取数据,但是,如果我尝试从PHP完成此操作,则无论使用哪种方法,它都将失败:
HTTP request failed! HTTP/1.0 401 Unauthorized
方法1:
$data = file_get_contents('http://admin:password@123.123.123.123:8086/connectioncounts');
方法2:
$handle = fopen('http://admin:password@123.123.123.123:8086/connectioncounts', "r")
方法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
标签:wowza,php,http-authentication 来源: https://codeday.me/bug/20191122/2057384.html