Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1675176
  • 博文数量: 20
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 3272
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-04 09:45
文章分类

全部博文(20)

文章存档

2011年(3)

2010年(1)

2009年(1)

2008年(15)

我的朋友

分类: LINUX

2008-03-06 17:40:06

A new workmate asked me how to get the verbose http header with the curl command in debian3.1. I used the curl command several times but I never used it to get the verbose information about http header. I tried the curl command with the verbose option, but I couldn't see the verbose infomation. Then I redirected the standard error stream into the standard output stream and redirected the output stream into a file. Finally, It worked. The following example is my resolution.
$output = array();
exec("curl -v  > /tmp/output.curl 2>&1", $output, $ret);
$output2 = array();
exec("cat /tmp/output.curl",$output2,$ret2);
print_r($output2);
?>
阅读(3030) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~