I'm going bananas trying to f-figure out why I am getting this error:

Fatal error: Undefined class name 'pear' in whatever/path/i/ran/command/from- on line 681

when I run

lynx -source http://pear.php.net/go-pear | php

😕 😕 😕

I have read elsewhere that there is a problem with the PHP module from entropy.ch (approved by apple) breaking Pear. I was able to install a Pear package earlier, but into the wrong path on my system. I seem to have two Pear installations. When I try to run the above command to fix my Pear path, I get the error. Searches all over the place have yielded no helpful advice.

Anyone here able to suggest anything?

    Is "pear" in your path?

    >whereis pear
    /usr/local/bin/pear
    
    echo $PATH
    /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/root/bin:
    

      Yup:

      $ whereis pear
      /usr/bin/pear
      $ echo $PATH
      /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/php/bin
      

      I'm completely lost on this one.

        OK, then, where is it expecting to find the libraries? Over here in BSD land, the whole thing is under /usr/local/share/PEAR, and the PEAR class is in /usr/local/share/PEAR/bootstrap/Pear.php ...

        Can you find Pear.php?

        #find /usr -name Pear.php -ls

          Thanks for responding btw..

          There are two copies of Pear.php:

          /usr/lib/php
          /usr/local/php/lib/php

            Try including one or the other of those dirs in your $PATH and then try the command again?

              Exactly the same result. Here is the full text... gives no clues to me:

              Loading zlib: ok
              Downloading package: PEAR.............ok
              Downloading package: Archive_Tar......ok
              Downloading package: Console_Getopt....ok
              Downloading package: XML_RPC..........ok
              Bootstrapping: PEAR...................(remote) ok
              Bootstrapping: Archive_Tar............(remote) ok
              Bootstrapping: Console_Getopt.........(remote) ok
              Downloading package: DB...............ok
              Downloading package: Net_Socket.......ok
              Downloading package: Net_SMTP.........ok
              Downloading package: Mail.............ok
              Downloading package: XML_Parser.......ok
              Downloading package: PHPUnit..........ok
              
              Fatal error: Undefined class name 'pear' in /Users/macosxguy/- on line 681
              

              It looks like everything has proceeded just fine, although I don't know what's supposed to happen next 😉

                OK, may last suggestion ... I've got to get to bed tonite...

                Can you first verify that "class PEAR" is initialized in the "Pear.php" that is in your path ... then try again, and then if it fails in the same manner copy the correct Pear.php into your homedir (or wherever you are running the lynx command) and see if that does it?

                I'm sorry, but not knowing much about this, I definitely feel like sleep is the better option for me (nothing personal, of course!! 😉 )

                It could certainly be an error in the script, I guess....

                  Hey man, thanks your your effort...I passed out from exhaustion before your last post.

                  Unfortunately I am still getting the same error. Would it be possible at all to completely wipe these two installations (one made by apple with the default php module, the other by entropy.ch's better php module installed later) and start over? How would I go about doing this cleanly? I'm a bit nervous about fiddling with my system. Any guidance would be greatly appreciated.

                    I wouldn't trust anything I had to say on this, considering it's a Mac.

                    People dump hardware on me occasionally because I have this habit of fixing it up and giving it away to churches, disabled people, etc.

                    So someone gave me two "Classic" Macs recently. I set one of 'em up and it took me 45 minutes to find the power button ... 😉

                    How likely are you to find some help at a place like macboards.com?

                      Hey man, OS X is just another flavour of Unix. 😉

                      I've posted a thread in the forums at entropy.ch hoping to get an answer... the traffic there is very low compared to this site though, so it could be 6 months to a year before I get an answer :p

                      Thanks for trying!

                        Well, yes; AAMOF, it is based, somewhat, on my OS of choice: FreeBSD.

                        However, the filesystem layout, the GUI, and the method of installation of various things are not "FreeBSD standard", so I'm not sure I can tell you want to do.

                        In FreeBSD, if PEAR isn't installed, it's as simple as (if you have root perms, that is 😉 ) :

                        $cd /usr/ports/devel/pear
                        $make install clean

                        I'm not sure I can tell you what to do on Mac, though; as another example of my "Mac stupid", I went to install Adobe's PDF reader on the same class Mac after I found the power button; although I could find the install file on the CD I'd burned, I couldn't figure how to run it to install.

                        Basically, since it's just a charity job anyway, I'm letting it sit over there until somebody else tells me how, heh, heh....

                          I decided that my Mac was clearly on crack and so just bit the proverbial bullet and reistalled the system. The storm clouds over my house have cleared, and PHP seems to be finding the correct PEAR.

                          ...now i just feel dirty and defeated...

                          Good luck with getting that Adobe reader installed

                          😉

                            Write a Reply...