Jump to content


PEAR newbie questions

  • Please log in to reply
No replies to this topic

#1 larry98765

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 05 March 2006 - 09:40 PM

Hi All,

I'm a PHP intermediate, but a newbie with PEAR.

Trying to get started using PEAR but having problems:

i.e. When trying to use DB in a script:


but I get this error:

Fatal error: Undefined class name 'pear' in /usr/lib/php/DB.php on line 540

That would tell me that DB is being found, but a dependency for DB (ostensibly PEAR) is not.

So I go to command line and type:

pear package-dependencies DB

and get:

Cannot open 'DB' for parsing

I don't know exactly what that means but it doesn't sound good. (I tried running the same command as sudo).

But when I do:

pear list

everything seems peachy:

Installed packages, channel pear.php.net:
Package              Version State
Archive_Tar          1.3.1   stable
Console_Getopt       1.2     stable
DB                   1.7.6   stable
DB_Pager             0.7     stable
DB_Table             1.2.1   stable
Date                 1.4.6   stable
HTML_Common          1.2.2   stable
HTML_QuickForm       3.2.5   stable
HTML_Template_IT     1.1.3   stable
HTTP                 1.4.0   stable
Mail                 1.1.9   stable
Net_SMTP             1.2.8   stable
Net_Socket           1.0.6   stable
Net_UserAgent_Detect 2.1.0   stable
PEAR                 1.4.7   stable
PHPUnit              1.3.2   stable
Pager                2.3.6   stable
XML_Parser           1.2.7   stable
XML_RPC              1.4.5   stable

and no problems installing new modules either. It's just that when I try to run DB in a script, it can't seem to "find" the base PEAR class?

So then just for kicks I add a second include, so it's like this:


which gives me this error:

Fatal error: Class db_error: Cannot inherit from undefined class pear_error in /usr/lib/php/DB.php on line 868

So now it's got the pear module but not the pear_error class?

Any ideas? Thanks in advance.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users