larry98765 Posted March 5, 2006 Share Posted March 5, 2006 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:[code]require_once('DB.php');[/code]but I get this error:[code]Fatal error: Undefined class name 'pear' in /usr/lib/php/DB.php on line 540[/code]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:[code]pear package-dependencies DB[/code]and get:[code]Cannot open 'DB' for parsing[/code]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:[code]pear list[/code]everything seems peachy:[code]Installed packages, channel pear.php.net:=========================================Package Version StateArchive_Tar 1.3.1 stableConsole_Getopt 1.2 stableDB 1.7.6 stableDB_Pager 0.7 stableDB_Table 1.2.1 stableDate 1.4.6 stableHTML_Common 1.2.2 stableHTML_QuickForm 3.2.5 stableHTML_Template_IT 1.1.3 stableHTTP 1.4.0 stableMail 1.1.9 stableNet_SMTP 1.2.8 stableNet_Socket 1.0.6 stableNet_UserAgent_Detect 2.1.0 stablePEAR 1.4.7 stablePHPUnit 1.3.2 stablePager 2.3.6 stableXML_Parser 1.2.7 stableXML_RPC 1.4.5 stable[/code]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:[code]require_once('PEAR.php');require_once('DB.php');[/code]which gives me this error:[code]Fatal error: Class db_error: Cannot inherit from undefined class pear_error in /usr/lib/php/DB.php on line 868[/code]So now it's got the pear module but not the pear_error class?Any ideas? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/4163-pear-newbie-questions/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.