pear module configuration

3 posts / 0 new
Last post
#1 Thu, 12/02/2010 - 13:36
thanecrossley.com

pear module configuration

Hi, I've used Virtualmin to install a pear module, and the VirtualMin UI indicates that the module is installed (HTTP_Request). However, my php code fails when I code against the module using the standard documented approach.

e.g. require_once "HTTP/Request.php";

$rseq =& new HTTP_Request("http://www.google.com/");
if (!PEAR::isError($req->sendRequest())) {
echo $req->getResponseBody();

My research suggests that the above code should work if the module is installed and configured properly. I have reason to believe that this is so, yet the code above still fails. I apologize if I'm missing something glaringly obvious.

P.S. I hope I've posted to the appropriate forum...

Thu, 12/02/2010 - 13:42
andreychek

It sounds like that may be installed, but not in your application's include_path.

Details on how the include_path works is here:

http://us.php.net/manual/en/ini.core.php#ini.include-path

The two ways of handling that would be:

  1. Modify the include_path in your $HOME/etc/php.ini file, and make sure that the include_path setup in it includes the location HTTP_Request was installed into.

  2. Rather than using the relative path "HTTP/Request.php", you could always use an absolute path such as "/full/path/to/HTTP/Request.pm".

    -Eric

Thu, 12/02/2010 - 19:33 (Reply to #2)
thanecrossley.com

Thanks! That made the difference. :)

Topic locked