我正在尝试通过PEAR安装PHP Mess Detector并获取这些401 Unauthorized
消息。但是,我可以通过浏览器访问相同的文件/ URL而不会出现问题。有谁知道如何解决这个问题?
我在Windows上,XAMPP,在代理服务器后面
在命令提示符下,我运行:
pear config-set http_proxy http://username:password@XX.XXX.X.XXX:80
响应:
config-set succeeded
我跑:
pear channel-discover pear.phpmd.org
我明白了:
Discovering channel pear.phpmd.org over http:// failed with message: channel-add:
Cannot open "http://pear.phpmd.org/channel.xml" (File http://pear.phpmd.org:80
/channel.xml not valid (received: HTTP/1.1 401 Unauthorized
( The server requires authorization to fulfill the request. Access to the Web server
is denied. Contact the server administrator. )
))
Trying to discover channel pear.phpmd.org over https:// instead
Discovery of channel "pear.phpmd.org" failed (channel-add: Cannot open
"https://pear.phpmd.org/channel.xml"
(File https://pear.phpmd.org:443/channel.xml not valid
(received: HTTP/1.1 401 Unauthorized
( The server requires authorization to fulfill the request.
Access to the Web server is denied. Contact the server administrator. )
但我可以毫无问题地在浏览器中打开http://pear.phpmd.org/channel.xml。
非常感谢任何帮助。
编辑1:
如果我将代理端口更改为8080,则会收到407 Proxy Authentication Required
条消息,因此我认为401错误不是由代理引起的,而是由远程主机引起的
pear config-set http_proxy http://username:password@XX.XXX.X.XXX:8080
我明白了:
Discovering channel pear.phpmd.org over http:// failed with message: channel-add:
Cannot open "http://pear.phpmd.org/channel.xml"
(File http://pear.phpmd.org:80/channel.xml not valid
(received: HTTP/1.1 407 Proxy Authentication Required
( The ISA Server requires authorization to fulfill the request.
Access to the Web Proxy service is denied. )
编辑2:
我检查过,这种情况发生在任何频道,所以这与乱七八糟的探测器无关。可能是防火墙/代理故障?
编辑3:
好的,我在浏览器中测试了代理设置。当我将端口设置为80时,网络无法访问,因此401错误意味着没有连接或什么?浏览器设置中的代理服务器端口8080按预期工作。所以,似乎梨没有正确通过我的证书。
我的用户名,密码和代理IP都是正确的 - 我检查了数百万次。
pear remote-list
File http://pear.php.net:80/rest/c/categories.xml not valid
(received: HTTP/1.1 407 Proxy Authentication Required
( The ISA Server requires authorization to fulfill the request.
Access to the Web Proxy service is denied.