Pecl安装pecl_http不工作


pecl install pecl_http not working.

我已经使用以下命令安装了php的http扩展,

**pecl install pecl_http**

成功,但是我找不到http。所以我的扩展/usr/lib/php5/20121212 + lfs 文件夹中。有什么需要我做的吗?

我使用下面的函数实现了http发布。我刚在网上找到的。

函数http_post_lite($url, $data, $headers=null) {

$data = http_build_query($data);    
$opts = array('http' => array('method' => 'POST', 'content' => $data,'header' => "Content-Type: application/x-www-form-urlencoded'r'n"));

if($headers) {
    $opts['http']['header'] = $headers;
}
$st = stream_context_create($opts);
$fp = fopen($url, 'rb', false, $st);
if(!$fp) {
    return false;
}
return stream_get_contents($fp);
}