通常我们调试WEB程序都是在 host配置文件绑定 xxx.com 192... ,然后重开浏览器,
curl 可以自动实现这块。
shell 代码
curl --silent -H "Host: www.zggo.com" "192.168.0.1/xxx/xxx/db.error.log"
php 代码
if(!empty($httpHeader) && is_array($httpHeader))
{
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
}
$data = curl_exec($ch);
$info = curl_getinfo($ch);
//var_dump($info);
curl_close($ch);
return $data;
}