Php 未定义的类常量方法

Php 未定义的类常量方法,php,httprequest,Php,Httprequest,我有以下php代码: #!/usr/bin/php -q <?php require_once 'HttpRequest.php'; $r = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet.php", HttpRequest::METH_GET); //$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-test.php", HttpRe

我有以下php代码:

#!/usr/bin/php -q
<?php
require_once 'HttpRequest.php';
$r = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet.php", HttpRequest::METH_GET);
//$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-test.php", HttpRequest::METH_GET);
$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-dev.php", HttpRequest::METH_GET);
你知道是什么导致了这个错误吗。我不得不手动下载一个HttpRequest,并将其放在该程序所在的目录中,因为我遇到了以下错误:

 PHP Fatal error:  Class 'HttpRequest' not found in /home/jsnyder/jsonmaker/map.php
根据我提供的信息,你能帮我解决这个问题吗?我应该如何安装HttpRequest以便在代码中使用它

谢谢你的帮助

必须手动下载一个HttpRequest并将其放入该程序所在的目录中,因为我遇到了错误:

 PHP Fatal error:  Class 'HttpRequest' not found in /home/jsnyder/jsonmaker/map.php
对我来说,这听起来像是你在某处下载了一个同名的随机类,然后祈祷它能正常工作


很可能您只是选择了错误的库。

是否安装了pecl扩展php_http?