![-bash:pear:未找到命令](https://linux22.com/image/1382342/-bash%EF%BC%9Apear%EF%BC%9A%E6%9C%AA%E6%89%BE%E5%88%B0%E5%91%BD%E4%BB%A4.png)
当我尝试通过终端安装 phpDoc 时出现以下错误:
-bash: pear: command not found
尽管我刚刚安装了pear。
在尝试安装 phpDoc 之前,我安装了 Pear,但收到以下警告:
WARNING! The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
</Users/Mike/pear/share/pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.
Current include path : .:
Configured directory : /Users/Mike/pear/share/pear
Currently used php.ini (guess) :
Press Enter to continue:
** WARNING! Old version found at /Users/Mike/pear/bin, please remove it or be sure to use the new /Users/Mike/pear/bin/pear command
The 'pear' command is now at your service at /Users/Mike/pear/bin/pear
** The 'pear' command is not currently in your PATH, so you need to
** use '/Users/Mike/pear/bin/pear' until you have added
** '/Users/Mike/pear/bin' to your PATH environment variable.
Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.
For more information about PEAR, see:
http://pear.php.net/faq.php
http://pear.php.net/manual/
Thanks for using go-pear!
有人能告诉我该怎么做才能解决这个问题吗?我确信这很简单,但我不知道从哪里开始。
答案1
您的输出中就显示了这一点:
** The 'pear' command is not currently in your PATH, so you need to
** use '/Users/Mike/pear/bin/pear' until you have added
** '/Users/Mike/pear/bin' to your PATH environment variable.
要将给定的命令添加到您的PATH
,请添加export PATH=$PATH:/Users/Mike/pear/bin/pear
到您的~/.bashrc
。