For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > April 2006 > Beginning with PEAR









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Beginning with PEAR
Romain SEGUY

2006-04-25, 7:04 pm

Hi

I'm just beginning using Pear and I cannot find any hint on how to get
rid of this error :

*Fatal error*: Undefined class name 'pear' in
*/var/virtual_www/libenti.com/ln.dev.libenti.com/htdocs/classes/CBDDUtilisateurs.php*
on line *7*

I just copied/pasted the "**Example 33-4. At last some real DataObject
Code.. ****from url
"http://pear.php.net/manual/en/package.database.db-dataobject.intro-purpose.php"...

I feel like there's some "include" statement missing... I searched
everywhere in the manual and with Google and found absolutely no hint.

The only thing i know is that Pear is installed (in /usr/share/pear) and
working. But I have no rights to see nor to access this directory on the
LAMP server.

Thanks for your help.

Romain SEGUY

2006-04-26, 8:00 am

Hi,

Thanks for Olivier Guilyardi for replying fast !

Sorry to bother again with my newbie questions, but I wasn't able to
find a solution either on PEAR website or with Google.

Once PEAR.php included, I still have a problem with DB/DataObject.php :

| require_once 'DB.php'; // No error

require_once 'DB/DataObject.php' ; // generates a warning : |*"Warning*: main(DB/DataObject.php): failed to open stream: No such file or directory"


Result : *"Fatal error*: main(): Failed opening required
'DB/DataObject.php' (include_path='.:/usr/share/php:/usr/share/pear')"

If I comment out "require_once 'DB/DataObject.php' ;", PHP tells me he
doesn't know the class 'DB_DataObject' when parsing "class
DataObjects_Person extends DB_DataObject {"

Is there a place describing PEAR directory/file structure ? I tried to
install PEAR locally but it's too much work, because I need to install
at least apache and PHP to download it (or I misunderstood something
again ?!?).

Thanks in advance,
R.S.

> When you use PEAR packages you should usually start with :
>
> require_once 'PEAR.php';
>
> That's often implicit in the manual examples.
>
> --
> og



Romain SEGUY wrote:
> Hi
>
> I'm just beginning using Pear and I cannot find any hint on how to get
> rid of this error :
>
> *Fatal error*: Undefined class name 'pear' in
> */var/virtual_www/libenti.com/ln.dev.libenti.com/htdocs/classes/CBDDUtilisateurs.php*
> on line *7*
>
> I just copied/pasted the "**Example 33-4. At last some real DataObject
> Code.. **from url
> "http://pear.php.net/manual/en/package.database.db-dataobject.intro-purpose.php"...
>
> I feel like there's some "include" statement missing... I searched
> everywhere in the manual and with Google and found absolutely no hint.
>
> The only thing i know is that Pear is installed (in /usr/share/pear)
> and working. But I have no rights to see nor to access this directory
> on the LAMP server.
>
> Thanks for your help.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com