【发布时间】:2014-06-20 09:08:12
【问题描述】:
我无法使用简单脚本安装 Perlbrew:curl -L http://install.perlbrew.pl | bash
我以前很容易做到,但现在,在全新的 CentOS 6.5 中,我收到 400 Bad Request。
这是输出:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
113 226 113 226 0 0 187 0 0:00:01 0:00:01 --:--:-- 187
bash: line 1: syntax error near unexpected token `newline'
bash: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'
如果我执行 curl 部分(不将其传递给 bash),这就是响应
curl -L http://install.perlbrew.pl
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body>
</html>
这是我的 Curl 版本: curl -V
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 协议:tftp ftp telnet dict ldap ldaps http 文件 https ftps scp sftp
功能:GSS 协商 IDN IPv6 大文件 NTLM SSL 库
通常的编译器也安装了yum groupinstall 'Development Tools'
什么会失败?真是奇怪……
【问题讨论】:
-
再试一次,它现在可以工作了。祝你好运。
-
这里不工作。也许我的新 Centos 缺少某些东西,或者不需要某些东西。该消息包括“您的浏览器发送了此服务器无法理解的请求”。所以 Curl(或 Bash)发送错误。