Yet another n00b question - PEAR packages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TDonaghe
Forum Newbie
Posts: 6
Joined: Mon Mar 13, 2006 1:42 pm

Yet another n00b question - PEAR packages

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...)
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post 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
TDonaghe
Forum Newbie
Posts: 6
Joined: Mon Mar 13, 2006 1:42 pm

Post 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.
TDonaghe
Forum Newbie
Posts: 6
Joined: Mon Mar 13, 2006 1:42 pm

Post 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.
Post Reply