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.

require_once “HTTP/Request.php”;

$rseq =& new HTTP_Request("");
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…

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

Details on how the include_path works is here:

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/”.


Thanks! That made the difference. :slight_smile: