tags:

views:

20

answers:

2

Hey guys I just installed HTTP_Download using Pear install --alldeps, and it installed successfully. However, when I try to use the module, I get. I am using the following php.ini include_path = ".:/usr/lib/php:/usr/local/lib/php". Is there a directory I should be including that is part of pear to get the module to work?

Fatal error: Class 'HTTP_Download' not found in /home/collab13/public_html/testing123.php on line 2
+1  A: 

looks like your PEAR Path is not within the includable paths.

try

$paths = explode(PATH_SEPARATOR,get_include_path());
$paths[] = '/path/to/pear';
$path_combined = implode(PATH_SEPARATOR,$paths);

set_include_path($path_combined);
ini_set('include_path',$path_combined);

then try and load the module, otherwise directly append it to your php.ini and restart the server.

RobertPitt
Thanks for the response, the thing I am not sure about, is what the path to pear is, I believe it is in php folder but which folder will specifically contain the modules that will make my script work? Is there a standard folder or a way of finding out which one it is? Also, your code, will apply to document and php.ini include path applies to all documents? does that mean that your way is most efficient if the module is not being widely used?
Scarface
the path is usually usually `/usr/lib/pear`
RobertPitt
that path did not exist but /usr/lib/php/PEAR did and when I used it I got Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 426942704 bytes) in Unknown on line 0
Scarface
take a look here, http://stackoverflow.com/questions/2186951/php-pear-validate-package-fatal-error-class-validate-not-found/2187312#2187312 and also try and remove the `include 'HTTP_Download.php'` and what not to see if its the module !
RobertPitt
+1  A: 

Your PEAR packages will get installed to whatever your php_dir setting is as shown in

 $ pear config-show  | grep php_dir

Change your include_path to include that directory and it should work for you.

kguest
thanks kguest, appreciate it
Scarface