How to set up a lamp to use pecl_http
(running lantern on ubuntu 12.10)
Hello,
I am trying to use the HttpRequest class for pecl_http
my php script looks like this
<?php
$r = new HttpRequest('http://localhost/test?msg=hello', HttpRequest::METH_GET);
$r->setOptions(array('lastmodified' => filetime('local.rss')));
$r->addQueryData(array('category' => 3));
try{
$r->send();
if($r->getResponseCode() == 200){
file_put_contents('local.rss', $r->getResponseBody());
}
}
catch (HttpException $ex){
echo $ex;
}
?>
I installed pecl_http by doing the following sudo / opt / lampp / bin / pecl install pecl_http
and on startup phpinfo()
I get that the dir for extensions /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226
and ls
this folder shows:
aly@krypton:/opt/lampp$ ls -al /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226
total 3208
drwxr-xr-x 2 root root 4096 Jan 2 17:58 .
drwxr-xr-x 3 root root 4096 Jan 2 16:35 ..
-rwxr-xr-x 1 root root 2333400 Jan 2 17:58 http.so
-rwxr-xr-x 1 root root 156824 Nov 17 14:33 oci8.so
-rwxr-xr-x 1 root root 144232 Nov 17 14:33 opcache.so
-rwxr-xr-x 1 root root 132480 Nov 17 14:33 pgsql.so
-rwxr-xr-x 1 root root 72488 Jan 2 17:56 propro.so
-rwxr-xr-x 1 root root 42960 Nov 17 14:33 radius.so
-rwxr-xr-x 1 root root 109746 Jan 2 17:57 raphf.so
-rwxr-xr-x 1 root root 61733 Jan 2 17:55 uploadprogress.so
-rwxr-xr-x 1 root root 203784 Nov 17 14:33 xdebug.so
I also edited php.ini
located at /opt/lampp/etc/php.ini
to have the following lines:
include_path = ".:/php/includes:/opt/lampp/include/php"
extension=propro.so
extension=raphf.so
extension=http.so
But when i load php i still get error Class 'HttpRequest' not found
Any ideas?
source to share
No one has answered this question yet
Check out similar questions: