I’ve tried using pear to install both phpunit and phpdoc and seem to be running into a problem with my pear installation.
following the installation guide here :
- You can prepare your PEAR installation using the following commands:
$ pear channel-discover pear.phpdoc.org
this gives me an error message:
-bash: pear: command not found
I’ve seen mention of using $ locate bin/pear to find the installation. This gives me the following message:
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
Not sure what that means, but if I’m reading it correctly, it’s saying that pear isn’t there. I know my path to pear is /Applications/MAMP/bin/php/php5.3.6/bin/pear /Applications/MAMP/bin/php/php5.3.6/bin/pear.
I’m a little lost on what to try next. Any suggestions on what I’m doing wrong?
Create your locate database using the command given. You can think of this in terms of the way spotlight has to “load” or index everything when you first install osx. ‘can take some time’ usually means ‘will take some time’
If you know your pear path you can execute it directly:
/Applications/MAMP/bin/php/php5.3.6/bin/pear channel-discover pear.phpdoc.orgor add an alias to it manually in your bash profile directory
http://blog.elucidcode.com/2011/03/terminal-aliases-in-os-x/
or make a link to it in
/usr/bin.For an overview. It seems pear is installed fine. Just when you type in ‘pear’ into the console osx doesn’t recognize that as being a command, Its like a shortcut on your desktop that doesn’t point to anywhere. What needs to be done (using one of the methods above) is to point the “desktop shortcut” (the
pearcommand) to the actually pear binary.