Sudo: pear: team not found

I have a snow leopard that apparently has php with a pear pre-installed. I enabled php but could not find any PEAR signs. So I installed it, and now phpinfo () shows its installation

include_path .:/usr/lib/php/share/pear

However, when I print any pear command

$ sudo pear

I get an error: sudo: pear: command not found

What am I missing?

+3
source share
4 answers

Many ways to trick this cat, but I would have typed it if you set the location (which you probably do):

$ locate bin/pear

This should list one or more things, one of which will look like a path to a pear. Say he says something like /usr/local/bin/pear. Then your next command:

$ sudo /usr/local/bin/pear

Two reservations come to mind:

  • , locate . , , , PHP .
  • , , pear PATH.
+7

$PATH , . bash, ( ):

mate ~/.bash_profile

:

export PATH=/usr/local/pear/bin:$PATH

,

: , trott. ( , )

+5

PHP (MAMP, ), pear /usr/local/bin:

cp /php5.3.2/pear /usr/local/bin/pear

var PATH "pear" .

+1

I had a similar problem and needed to update secure_path in sudoers as it overrides the user $ PATH.

Check secure_path on sudo

[root@host ~]# sudo -V | grep 'Value to override'
Value to override user $PATH with: /sbin:/bin:/usr/sbin:/usr/bin

If $PATHoverestimates us visudoand edits/etc/sudoers

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
0
source

All Articles