如何配置lampp使用pecl_http

时间:2015-01-02 18:11:02

标签: php xampp php-extension pecl lampp

(在ubuntu 12.10上运行lampp)

您好,

我正在尝试使用pecl_http的

我的php脚本如下

<?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;
        }
?>

我已经通过执行以下操作安装了pecl_http sudo / opt / lampp / bin / pecl install pecl_http

并且在运行phpinfo()时,我将扩展程序目录设为/opt/lampp/lib/php/extensions/no-debug-non-zts-20131226,并且该文件夹的ls显示:

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

我还修改了位于php.ini的{​​{1}}以获得以下内容:

/opt/lampp/etc/php.ini

但是当我加载php时,我仍然会收到错误include_path = ".:/php/includes:/opt/lampp/include/php" extension=propro.so extension=raphf.so extension=http.so

有什么想法吗?

0 个答案:

没有答案