php - pecl install pecl_http not working. -
i have installed http extension php using following command,
**pecl install pecl_http**
its successfull, cannot find http.so extension in /usr/lib/php5/20121212+lfs folder. there have do?
i ve acheived http posting using following function. found in internet.
function 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); }
Comments
Post a Comment