Page 1 of 1

Yet another n00b question - PEAR packages

Posted: Thu Mar 16, 2006 10:50 am
by TDonaghe
If my ISP tells me that I have the PEAR HTTP package installed, does that mean that the HTTP_Request package is also installed, or is that something else that needs to be added? Depending on the answer to this I will probably have a couple of followup questions.

Thanks! And please forgive me my noobiness.

Posted: Thu Mar 16, 2006 12:02 pm
by timvw
Why don't you read the pear documentation? (if i'm not mistake the command is something like "pear list" or something like that...)

Posted: Thu Mar 16, 2006 12:09 pm
by Buddha443556
I would think only your ISP can tell you want they meant. Don't forget your paying them for a service which includes clarifying their answer when necessary.

However, you could just try including the package in question and see if it works.

Code: Select all

<?php
require_once "HTTP/Request.php";

$req =& new HTTP_Request("http://www.yahoo.com/");
if (!PEAR::isError($req->sendRequest())) {
    echo $req->getResponseBody();
}
?>
... from http://pear.php.net/manual/en/package.h ... .intro.php

Posted: Thu Mar 16, 2006 12:48 pm
by TDonaghe
timvw wrote:Why don't you read the pear documentation? (if i'm not mistake the command is something like "pear list" or something like that...)
I would, but I don't have access through this ISP to run commands like that.

Posted: Thu Mar 16, 2006 12:50 pm
by TDonaghe
Buddha443556 wrote:I would think only your ISP can tell you want they meant. Don't forget your paying them for a service which includes clarifying their answer when necessary.

However, you could just try including the package in question and see if it works.

Code: Select all

<?php
require_once "HTTP/Request.php";

$req =& new HTTP_Request("http://www.yahoo.com/");
if (!PEAR::isError($req->sendRequest())) {
    echo $req->getResponseBody();
}
?>
... from http://pear.php.net/manual/en/package.h ... .intro.php
I have code that looks like this:

Code: Select all

echo "before";
        require_once 'HTTP/Request.php';
        echo "after";
EDIT: Oops forgot to include the fact that I see "before" getting echo'd, but not "after" or anything after that. I'm guessing that's because the require_once line failed.

My include path, which I got from doing this:

Code: Select all

echo ini_get('include_path');
looks like this:

:/usr/share/pear

My ISP support guy told me that he's installed the HTTP_Request package and he's looking to see if something is set up wrong.