Php 如何配置lampp以使用pecl_http
(在ubuntu 12.10上运行lampp) 嗨 我正在尝试使用pecl_http的HttpRequest类 我的php脚本如下Php 如何配置lampp以使用pecl_http,php,xampp,php-extension,pecl,lampp,Php,Xampp,Php Extension,Pecl,Lampp,(在ubuntu 12.10上运行lampp) 嗨 我正在尝试使用pecl_http的HttpRequest类 我的php脚本如下 <?php $r = new HttpRequest('http://localhost/test?msg=hello', HttpRequest::METH_GET); $r->setOptions(array('lastmodified' => filetime('local.rss')));
<?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;
}
?>
我还编辑了位于/opt/lampp/etc/php.ini
的php.ini
,使其具有以下行:
include_path = ".:/php/includes:/opt/lampp/include/php"
extension=propro.so
extension=raphf.so
extension=http.so
但是当我加载php时,仍然会出现错误Class'HttpRequest'未找到
有什么想法吗
include_path = ".:/php/includes:/opt/lampp/include/php"
extension=propro.so
extension=raphf.so
extension=http.so