php pecl:找不到命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1625161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
pecl:command not found
提问by jdee
I'm trying to run the following command in terminal on my macbook pro
我正在尝试在 macbook pro 的终端中运行以下命令
cd /tmp; pecl download memcached
but im getting
但我得到
pecl:command not found.
pecl:找不到命令。
after a days googling I cant find out whats up. Does anyone have a solution?
经过几天的谷歌搜索,我不知道发生了什么。有没有人有办法解决吗?
采纳答案by bisko
At least on Arch Linux you must install php-pearpackage for the pecl tool by using this command:
至少在 Arch Linux 上,您必须使用以下命令为 pecl 工具安装php-pear包:
pacman -S php-pear
回答by Chadams
apt-get update
apt-get install php-pear php5-dev
回答by fred
I know, old post but for anyone else.
我知道,旧帖子,但对于其他人。
On Windows PECL and PEAR commands are not found but they are pre-installed in PHP.
在 Windows 上找不到 PECL 和 PEAR 命令,但它们已预先安装在 PHP 中。
They are not in the windows path so you have to cd into the PEAR directory to run the command or add the PEAR directory to your systems path variable
它们不在 Windows 路径中,因此您必须 cd 进入 PEAR 目录才能运行命令或将 PEAR 目录添加到系统路径变量中
There is a .bat file in the PEAR directory which is supposed to do this for you if you double click it but it did not work for me on win7 so I manually add the path or just cd to the directory to run it
PEAR 目录中有一个 .bat 文件,如果您双击它,它应该为您执行此操作,但它在 win7 上对我不起作用,因此我手动添加路径或仅将 cd 添加到目录中以运行它
回答by KevinY
Old thread but might be useful for someone... On OSX with MAMP installed its best to find out which version of php installed (from the /Applications/MAMP/bin/php/* directory).
旧线程,但可能对某人有用......在安装了 MAMP 的 OSX 上,最好找出安装的 php 版本(从 /Applications/MAMP/bin/php/* 目录)。
Then either temporarily
然后要么暂时
export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH
or permanently
或永久
echo "export PATH=/Applications/MAMP/bin/php/php5.5.3/bin:$PATH" >> ~/.profile
then
然后
which pecl
then tells you, e.g.
然后告诉你,例如
/Applications/MAMP/bin/php/php5.5.3/bin/pecl

